In Oracle SQL, why doesn’t ROWNUM = 2 work?

The inspiration for this post came after recently overhearing a developer asking why his query was not returning a row. It had been working fine, the only change was instead of ROWNUM = 1, he had changed it to ROWNUM = 2. The query was could have been doing something similar to the following: which […]

Sorting an Oracle Nested Table

This article demonstrates a method used to sort an Oracle nested table collection from within PL/SQL . The example that follows was built using the Oracle Developer Days Environment and used the following versions: Oracle Linux running via Oracle Virtual Box Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 Oracle SQL Developer 3.2.20.10 The user developing […]

Formatting the output from dbms_xplan.display_cursor

I have in the past struggled with the myriad of formatting options available with dbms_xplan.display_cursor so I was pleased to learn about a quick and easy to remember way of formatting the results at this years UKOUG conference. First execute the SQL statement of interest including the gather_plan_statistics hint: Then run dbms_xplan.display_cursor: The key point is […]