I have two cursors I am comparing. I would compare cursor1 if exists in all rows of cursor2. I tried below but it seems stopping at 1st match.
CURSOR cursor1 IS
SELECT col1, col2 FROM table1;
CURSOR cursor2 IS
SELECT col1, col3 FROM table2;
c1_rec cursor1%ROWTYPE;
c2_rec cursor2%ROWTYPE;
BEGIN
OPEN cursor1;
OPEN cursor2;
LOOP
FETCH cursor1 INTO c1_rec;
FETCH cursor2 INTO c2_rec;
EXIT WHEN cursor1%NOTFOUND OR cursor2%NOTFOUND;
IF c1_rec.col1 = c2_rec.col1 OR c1_rec.col2 = c2_rec.col3 THEN
DBMS_OUTPUT.PUT_LINE('Match in row: ' || SQL%ROWCOUNT);
END IF;
END LOOP;
CLOSE cursor1;
CLOSE cursor2;
END;
/