TextFile1.txt 1006 B

1234567891011121314151617181920212223242526
  1. declare
  2. v_res varchar2(4000);
  3. v_sql varchar2(4000);
  4. v_head varchar2(4000);
  5. v_last varchar2(4000);
  6. v_sqlall varchar2(4000);
  7. begin
  8. for i in (select *
  9. from user_tables a
  10. where rownum < 10)
  11. loop
  12. v_head := 'select ' || '''' || 'public static class ' || i.table_name || '{ ' || '''' ||
  13. ' from dual ';
  14. v_last := 'select ' || '''' || '} ' || '''' || ' from dual ';
  15. v_sql := 'select * from (select ' || '''' ||
  16. ' public static string a.COLUMN_NAME = ' || '''' || '||' || '''' || '"' || '''' || '||' ||
  17. 'COLUMN_NAME' || '||' || '''' || '";' || '''' || ' ' ||
  18. ' from user_tab_columns a' || ' where a.TABLE_NAME = ' || '''' ||
  19. i.table_name || '''' || ' order by a.COLUMN_ID)';
  20. v_sqlall := 'insert into test select * from (' || v_head||' union all '|| v_sql ||' union all '|| v_last||')';
  21. execute immediate v_sqlall;
  22. --dbms_output.put_line(v_res);
  23. end loop;
  24. end;