set linesize 130;
set pagesize 10000;
set long 50;
set echo on;

/* ************************************************ */
/*                                                  */
/* script to perform the select * from all          */
/*   tables under all schemas                       */
/*                                                  */
/*         @\rkupcuna\sql\bld_dump.sql              */ 
/*                                                  */
/* ************************************************ */

set echo off;

select 'SELECT * FROM '||owner||'.'||table_name||';'
from all_tables 
where owner      = upper('&&schema') and
      table_name = upper('&&TABLE_NAME')
ORDER BY owner, table_name;

spool cnt_each.sql
/
spool off;
undefine schema;
undefine TABLE_NAME;

spool cnt_each.rslt
@cnt_each
/
spool off;
commit;

