Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to check in a cursor if there is no data

436061Jan 10 2005 — edited Jan 18 2005
I have declared a cursor in a statement lever trigger. Now when there are not records matching the select criteria, the trigger is throwing the error ora-01403: no data found and terminating...

after defining the cursor, in the body of the cursor, I am checking if the number of records found in cursor is zero or not...
but as of now, my trigger is not moving beyond the cursor declaration. How can I handle this situation?

cursor c1 is
select order_id, order_id_pred from order_dependency
where order_id=temp(0).order_id ;

begin

for x in c1
loop
order_id_count := order_id_count+1;
--this will give you the count of the rows in the cursor
end loop;


end...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 15 2005
Added on Jan 10 2005
7 comments
900 views