HSQLDB ROWNUM compatibility with Oracle

試著忘記壹切 提交于 2019-12-03 17:47:55

问题


THe HSQLDB changelog states that ROWNUM() was added in v2.2.0 which I am using without any problems when running integration tests against the in-memory HSQLDB.

However I want to run the same tests against a real Oracle 10g database, but the query fails because the pseudo-column is called ROWNUM. Is there an easy way write a single query string that works in both environments?


回答1:


The ROWNUM() function is available by default in HSQLDB 2.2.x and later. If you enable Oracle syntax compatibility mode, you can also use ROWNUM.

This statement enables it:

SET DATABASE SQL SYNTAX ORA TRUE

Or use the connection property sql.syntax_ora=true



来源:https://stackoverflow.com/questions/6612862/hsqldb-rownum-compatibility-with-oracle

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