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: LEVEL as a fieldname

Re: LEVEL as a fieldname

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 07 Jul 2004 21:10:23 -0700
Message-ID: <1089259836.287472@yasure>


spita wrote:

> Hai everybody,
>
> Can anybody tell me what to do when you have for example an oracle database
> and a table contains a field called LEVEL.
>
> How do I use the select command then ?
>
> When I use:
> SELECT level
> FROM table
>
> I will get an error message, because LEVEL is also a command known in SQL.

You learn to run the following query:

SELECT keyword
FROM vv$reserved_words
WHERE keyword LIKE 'LEV%';

Then you do this:

ALTER TABLE <table_name>
RENAME COLUMN level TO <new_name>;

There is no workaround for misusing reserved words.

Daniel Morgan Received on Wed Jul 07 2004 - 23:10:23 CDT

Original text of this message

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