Name: kanaka Date: April 18, 2008 at 05:55:53 Pacific Subject: sending output to flatfile OS: unix CPU/Ram: n/a Model/Manufacturer: n/a
Comment:
Hi, I am writing one unix script to get row count of few tables into one sequential file my script is like this $ORACLE_HOME/bin/sqlplus -s <<EOF >output.txt userid/password@databasename set verify off set heading off set feedback off select count(*) count from tablel; select count(*) count from table2; select count(*) count from table3; exit; EOF
I actually have a whole process that involves SQLPlus and a whole bunch of queries. I recommend sending the queries to their own files so you can just do a line count; something like this: #!/usr/bin/ksh sqlplus -s <<EOF > outfile.txt username/password@database set verify off set heading off set feedback off spool table1.csv select count(*) count from tablel; spool table2.csv select count(*) count from table2; spool table3.csv select count(*) count from table3; exit; EOF
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE