1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
PROCEDURE PRC_DISPLAY_REQUEST_ID(p_user_id IN VARCHAR2(13),
request_cursor OUT T_CURSOR
)
IS V_CURSOR1 T_CURSOR;
DECLARE
/* Output variables to hold the result of the query: */
a BPSBT_REQUEST.REQUEST_ID%TYPE;
/* Cursor declaration: */
CURSOR T1Cursor IS
SELECT DISTINCT request_id FROM bpsbt_request_process;
BEGIN
OPEN T1Cursor;
LOOP
/* Retrieve each row of the result of the above query
into PL/SQL variables: */
FETCH T1Cursor INTO a;
/* If there are no more rows to fetch, exit the loop: */
EXIT WHEN T1Cursor%NOTFOUND;
/* Delete the current tuple: */
OPEN V_CURSOR1 FOR
SELECT request_id from bpsbt_request_process where request_id = a and user_key_recipient = p_user_id and request_status_id = 0 and request_process_date in (select max (request_process_date) from bpsbt_request_process where request_id = a);
END LOOP;
/* Free cursor used by the query. */
CLOSE T1Cursor;
request_cursor := V_CURSOR1;
END PRC_DISPLAY_REQUEST_ID; |
Partager