CREATE OR REPLACE PROCEDURE C_PUT
(p_partition_name in varchar2,
p_dat_no number
r_ref out sys_refcursor)
CURSOR CUR IS
'SELECT PAT_NO, PNAME, OT_P
FORM TARGET.PATENTS partition ('||p_partition_name||')
WHERE DAT_NO = p_dat_no
ORDER BY PAT_NO
FOR UPDATE SKIP LOCKER;'
BEGIN
IF CUR%ROWCOUNT > 0 THEN
DBMS_OUTPUT.PUT_LINE('There are rows to process');
RETURN as Refcursor
Else
DBMS_OUTPUT.PUT_LINE('NO rows to process');
END IF;
END;
|