HSQLDB ROWNUM 与 Oracle 的兼容性
HSQLDB 变更日志 指出 ROWNUM()
是在 v2.2.0 中添加的
在针对内存 HSQLDB 运行集成测试时,我使用它没有任何问题。
不过,我想对真实的 Oracle 10g 数据库运行相同的测试,但查询失败,因为伪列名为 ROWNUM
。有没有一种简单的方法可以编写在两种环境下都有效的单个查询字符串?
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?
ROWNUM() 函数在 HSQLDB 2.2.x 及更高版本中默认可用。如果启用Oracle语法兼容模式,还可以使用ROWNUM。
此语句启用它:
或使用连接属性
sql.syntax_ora=true
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:
Or use the connection property
sql.syntax_ora=true