declare
t_name varchar2(100) := upper('dba_tab_columns');
cursor c_col is select column_name from dba_tab_columns where table_name = t_name order by column_id;
v_sql varchar2(2000);
begin
v_sql := 'SELECT ';
for r_col in c_col loop
v_sql := v_sql || r_col.column_name || ', ';
end loop;
v_sql := substr(v_sql, 1, length(v_sql) - 2) || ' FROM ' || t_name || ';';
dbms_output.put_line(v_sql);
end;