Thursday, August 16, 2007

sqlplus shell script

sqlplus -s username/passwd@XXXXXXXXXXXX << ORA_CMD

set pages 50000;
set lines 1000;
set trims on;
set heading off;
set feedback off;
spool data/$filename.txt;

/* OUTPUT FORMAT */

prompt bla....bla...bleh;
select ........... bla....bla...bleh; /* Query */
spool off;
quit

ORA_CMD

0 Comment :