I have a Procedure in Oracle that takes a varchar2
paramater. Based on the value of that parameter, I need to define a cursor. The cursor will operate on diff
You can even use the condition inside the implicit for loop. Without cursor declaration or SYS_REFCURSOR
(I dislike them sorry) - I mean you can use your variables, here v_action
, inside implicit cursor declaration:
BEGIN
FOR this_cur IN (
SELECT * FROM
WHERE v_action = 'DO THIS'
) LOOP
<>
END LOOP;
FOR that_cur IN (
SELECT * FROM
WHERE v_action <> 'DO THIS'
) LOOP
<>
END LOOP;
END IF;
END;