Got an Oracle Table Named as Reserved Word, Which problems may arise?

青春壹個敷衍的年華 提交于 2019-12-13 15:26:15

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/4750211/got-an-oracle-table-named-as-reserved-word-which-problems-may-arise

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!