I have a PL/SQL procedure that is passed a valid SELECT statement as a VARCHAR2 parameter. I would like to be able to get the column names from this statement. Below is a simple example of that gets to the root of what i'd like to do.
CREATE OR REPLACE PROCEDURE proc_print_col_names (p_select IN VARCHAR2)
v_column_name VARCHAR2(255) := NULL;
v_column_name := ????? -- Get first column from p_select
WHILE v_column_name IS NOT NULL LOOP
DBMS_OUTPUT.PUT_LINE('Column Name = ' || v_column_name);
v_column_name := ????? -- Get next column from p_select