Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: The reserved word "ACCESS" in a field list of a PL SQL Query
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.
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
![]() |
![]() |