Jeg tror, du kan bruge DESCRIBE_COLUMNS til at gøre dette. Indsæt blot markøren og de andre nødvendige parametre.
http://docs.oracle.com/cd /B19306_01/appdev.102/b14258/d_sql.htm#i1026120
declare
v_sql varchar2(32767) := 'select 1 column1, 2 column2 from dual';
v_cursor_id integer;
v_col_cnt integer;
v_columns dbms_sql.desc_tab;
begin
v_cursor_id := dbms_sql.open_cursor;
dbms_sql.parse(v_cursor_id, v_sql, dbms_sql.native);
dbms_sql.describe_columns(v_cursor_id, v_col_cnt, v_columns);
for i in 1 .. v_columns.count loop
dbms_output.put_line(v_columns(i).col_name);
end loop;
dbms_sql.close_cursor(v_cursor_id);
exception when others then
dbms_sql.close_cursor(v_cursor_id);
raise;
end;
/
Output:
COLUMN1
COLUMN2