Showing posts with label ROWNUM. Show all posts
Showing posts with label ROWNUM. Show all posts

Wednesday, July 11, 2012

LEVEL trick that fails


This simple trick works fine in Oracle, but fails in DB2 in Oracle compatible mode:


db2 => select rownum from dual connect by level <= 10;

ROWNUM
--------------------
SQL20451N Cycle detected in a hierarchical query. SQLSTATE=560CO



So, at least for now ( July 2012), Oracle folks would have lost a handy way to generate data in DB2 under compatible mode.