March 2012
Intermediate to advanced
442 pages
9h 31m
English
The ROWNUM and DUAL supports are enabled by setting the DB2_COMPATIBILITY_VECTOR registry variable to ORA.
Oracle programmers use ROWNUM quite often to retrieve a controlled number of rows from a SQL statement. The same can be applied in DB2 9.7.
Enable the compatibility feature by setting the DB2_COMPATIBILITY_VECTOR registry to ORA.
In earlier versions of DB2, when we wanted to return only a specific number of rows of an SQL statement, we used the FETCH FIRST clause. Now that we have the Oracle compatibility feature enabled in DB2 9.7, we can use ROWNUM as in Oracle. In DB2, ROWNUM supports<, >, >=, <=, =, and BETWEEN operators.
We can combine ROWID and ROWNUM together to display the ...
Read now
Unlock full access