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 delete rows from a cursor with criteria from another cursor?

1050844Oct 28 2013 — edited Oct 28 2013

Hi guys, this is my first time using PL/SQL.

I have 2 cursors that have a unique number that connects each other, say Student_ID.

If there is same Student_ID found in the first cursor, I have to delete it from the second cursor.

I found something like this but don't really understand how it goes:

open c1; 
fetch c1 into cnumber;

if c1%notfound then
  cnumber
:= 9999;

else
  
DELETE FROM courses_tbl
  
WHERE CURRENT OF c1;

  
COMMIT;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2013
Added on Oct 28 2013
8 comments
1,510 views