This content has been marked as final. Show 11 replies
Pipe the whole sqlplus-command to /dev/null?1 person found this helpful
There might be a sqlplus setting that does this: but it doesn't pop into my mind right now.
you can redirect to /dev/null1 person found this helpful
$(sqlplus username/password@$_SID <<EOF set colsep , set pagesize 0 set trimspool on set headsep off set linesize 150 spool /tmp/myfile.dat SELECT COL1 FROM TABLE1 EOF) > /dev/null
I think it's1 person found this helpful
SQL> set termout off
But I believe you need to run it as a sql plus file. In other words,
The way you're doing it...I'm not sure if it will work.
SET TERMOUT OFF1 person found this helpful
Hi,1 person found this helpful
You can call sqlplus with the -s options to avoid the login banner and prompt.
And use set termout off to keep stuff from displaying.
Actually the termout is for script I think.
From command line you can do it that way :
Edited by: Nicosa on Dec 2, 2010 10:47 AM
$ sqlplus -s scott/tiger << EOF 2>&1> /dev/null select sysdate from dual; select table_name from user_tables; exit EOF
redirecting to /dev/null didn't work for me, have tried all and got syntax error. I'm doing it inside ksh like will be in prod.
Trying to run from @sql_script.sql
Yes SET TERMOUT is the way to do it and it requires a script - it doesn't do anything at an interactive prompt.
If you have a lot of data to dump you might bump arraysize up a bit while you're at it.
Do I need to have all this inside the @, or I have to put login line separately, It doesn't work for me like this
sqlplus username/password@$_SID <<EOF set colsep , set termout off set trimspool on set linesize 150 spool /tmp/myfile.dat SELECT COL1 FROM TABLE1 EOF
Put all that stuff in a separate script file and run it in a single command like this:
sqlplus username/password@SID @your_script_file.sql
If this is to be an automated process, you should include an EXIT as the last line of the script file.
worked as expected, just need to see what else option to use ot cut that trailing info line:
40 rows selected.
SQL> set feedback off