I need to list public views, their owners and column names in each view
I have written the query to display views and owner names but cant figure out how to display column names for each view under the view. I am adding my script below
Could someone help me with this
declare
viewname varchar2(200);
owner_name varchar2(200);
CURSOR T1Cursor is
select view_name,owner from all_views where view_name like 'PUB%';
begin
open T1Cursor;
LOOP
FETCH T1Cursor into viewname,owner_name;
EXIT WHEN T1Cursor%NOTFOUND;
dbms_output.put_line(viewname||' '|| owner_name);
/* NEED to DISPLAY COLUMN NAMES OF EACH VIEW OBTAINED FROM CURSOR*/
/*select column_name from all_tab_columns where table_name=viewname;*/
END LOOP;
CLOSE T1Cursor;
END;
Thanks