oracle保留字 字段名冲突,有一个Oracle表命名为保留字,可能会出现哪些问题?…

  • Post author:
  • Post category:其他


We just got a system outsourced and at first glance i can see some tables and fields with names as CASE or FROM. It is an Oracle 10g DB and we are going to be consuming those data from Java, Hibernate, C#, C++.

Is there something special we should be aware of?

For what i’ve seen in other posts this is not recommended because it will affect readability of our code, but is there any other, major or more serious problems this could cause?

Thanks!

解决方案

To escape reserved words in Oracle, you need to enclose them (in this case, the table name) in double quotes. IE:

SELECT *

FROM “CASE”

Otherwise, you’ll get an “ORA-00903: Invalid table name” error. IIRC, Oracle treats text inside of double quotes as case sensitive so you can still get the error if the table name was created in lowercase when using the example query.

Other than that, I can only see the usual issue with poorly named entities/attributes.