How To Handle Table Column Named With Reserved Sql Keyword?

Viewed 31910

I have a table that has a column named RANK which is a keyword in Oracle.

Now I need to insert data in this table :

insert into mytbl (RANK)
select RANK from other_table

when executing this query I got the following error :

ORA-00907: missing right parenthesis

How does one escape a keyword?

4 Answers

It has been mentioned before, but to emphasize, one must exactly match the case in all uses. When I needed to extract the GROUP column and order it, "Group" did not work. It had to be "GROUP" in both cases such as

select "GROUP" from PICKLIST
order by "GROUP"
Related