Friday, May 15, 2009

Bulk collect limit clause and %NOTFOUND

Recently I have learned that when using limit clause in the bulk collect, if one sets limit to be N, and if Oralce is unable to fetch N records from the cursor C (even being able to fetch N-1 records), then Oracle will evaluate C%NOTFOUND to TRUE.

Steven Feuerstein has a good article on this topic: http://www.oracle.com/technology/oramag/oracle/08-mar/o28plsql.html .

The whole story can be seen in my post on Oracle-PLSQL google group:
http://groups.google.com/group/Oracle-PLSQL/browse_thread/thread/3928ff1d0a4fad50

No comments: