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
| CREATE OR REPLACE PROCEDURE proc_test
IS
TYPE typ_big_tab IS TABLE OF DBMS_SQL.date_table;
big_tab typ_big_tab := typ_big_tab ();
source_cursor INTEGER;
ignore1 INTEGER;
ignore2 INTEGER;
BEGIN
source_cursor := DBMS_SQL.open_cursor;
DBMS_SQL.parse (source_cursor,
'SELECT sysdate, sysdate+1 from dual',
DBMS_SQL.native
);
big_tab.EXTEND;
DBMS_SQL.define_array (source_cursor, 1, big_tab (1), 1, 1);
big_tab.EXTEND;
DBMS_SQL.define_array (source_cursor, 2, big_tab (2), 1, 1);
ignore1 := DBMS_SQL.EXECUTE (source_cursor);
ignore2 := DBMS_SQL.fetch_rows (source_cursor);
DBMS_SQL.COLUMN_VALUE (source_cursor, 1, big_tab (1));
DBMS_SQL.COLUMN_VALUE (source_cursor, 2, big_tab (2));
DBMS_SQL.close_cursor (source_cursor);
EXCEPTION
WHEN OTHERS
THEN
IF DBMS_SQL.is_open (source_cursor)
THEN
DBMS_SQL.close_cursor (source_cursor);
END IF;
RAISE;
END;
/ |
Partager