Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: The reserved word "ACCESS" in a field list of a PL SQL Query

Re: The reserved word "ACCESS" in a field list of a PL SQL Query

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 08 Sep 2004 18:43:23 -0700
Message-ID: <1094694265.869512@yasure>


Lee wrote:

> We have a field in our tables call "ACCESS", but we are unable to
> reference this field in a query becuase it appears to be a reserved
> word in Oracle (we are running Oracle 10g on Windows 2k).
>
> A query like the following results in a "Ora-00936:Missing Expression"
> error message:
> SELECT Access FROM sys.MyTable.
>
> The Field "Access" is a valid field within the table "MyTable".
>
> Additionally, our application dynamically builds this query so any
> soluiton that includes "Aliasing" this field probably will not work.
>
> Is there anyway around quering this field in the table without
> re-naming the field in the table?
>
> Thanks for any info that can be provided.
> Lee

<VICIOUS RANT>
Why would anyone allow you to "access" an Oracle database given that you have managed to commit two egregious sins in a single SQL statement.

  1. Never ever for any reason build anything as SYS. Had you done so on a project I manage you'd be fired. Had you done so in one of my classes you would fail.
  2. Learn the following query:

SELECT keyword FROM v$reserved_words
WHERE keyword = 'ACCESS';

Don't fix the problem by using the double quotes as Michel suggest. Fix the problem by hiring someone that knows what they are doing. And while waiting for that person to start working ...

ALTER TABLE <table_name>
RENAME COLUMN "ACCESS" TO <something_intelligent>; </VICIOUS RANT>

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Sep 08 2004 - 20:43:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US