Один из методов - использовать вложенную таблицу с переменной записи all_tab_columns%rowtype
, а затем просмотреть ее для просмотра.
SET SERVEROUTPUT ON
DECLARE
TYPE tab_all_tab_rec IS
TABLE OF all_tab_columns%rowtype;
trec tab_all_tab_rec;
v_where_clause CLOB := 'WHERE OWNER = ''HR''';
BEGIN
EXECUTE IMMEDIATE 'SELECT *
FROM all_tab_columns ' || v_where_clause BULK COLLECT
INTO trec;
FOR i IN trec.first..trec.last LOOP
dbms_output.put_line(trec(i).owner || ',' || trec(i).table_name || ',' || trec(i).column_name
); --Other columns
END LOOP;
END;
/
O / р
HR,COUNTRIES,COUNTRY_NAME
HR,COUNTRIES,COUNTRY_ID
HR,COUNTRIES,REGION_ID
HR,DEPARTMENTS,LOCATION_ID
HR,DEPARTMENTS,MANAGER_ID
HR,DEPARTMENTS,DEPARTMENT_NAME
HR,DEPARTMENTS,DEPARTMENT_ID
HR,EMPLOYEES,DEPARTMENT_ID
HR,EMPLOYEES,MANAGER_ID
HR,EMPLOYEES,COMMISSION_PCT
HR,EMPLOYEES,SALARY
HR,EMPLOYEES,JOB_ID
HR,EMPLOYEES,HIRE_DATE
HR,EMPLOYEES,PHONE_NUMBER
HR,EMPLOYEES,EMAIL
HR,EMPLOYEES,LAST_NAME
HR,EMPLOYEES,FIRST_NAME
HR,EMPLOYEES,EMPLOYEE_ID
..
..
PL/SQL procedure successfully completed.