Radi Radi - 1 month ago 5
SQL Question

How To Handle Table Column Named With Reserved Sql Keyword?

I have an old table that has a column named "RANK" and this name is a keyword in Oracle,
I don't know how this table created and I can't rename this column because it is used by other applications .
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

Kindly, how can I solve this problem?



Oracle uses double quotes " to escape reserved words.

insert into mytbl ("RANK")
select "RANK" 
from other_table

One other note, Oracle requires correct case as well.