Home » Other » Client Tools » Display option in sqlplus (oracle 10 g)
icon4.gif  Display option in sqlplus [message #451035] Mon, 12 April 2010 04:12 Go to next message
veemani
Messages: 10
Registered: July 2009
Location: Chennai
Junior Member
Hi,
I m currently written a sqlplus query and executing as below

sqlplus -s << !
set head off pages off trimspool on termout off
spool sysdate.txt
select sysdate from dual;
spool off
!

With this query the sysdate is getting written in the sysdate.txt but it is also getting printed in the screen/terminal., which I don't need to. Is their any options available for that.

Note: I came to know that "Termout off" will work only when we execute the query from a file and as a result I can still see the sysdate getting displayed in the screen.

Can anyone help me on this?
Re: Display option in sqlplus [message #451046 is a reply to message #451035] Mon, 12 April 2010 04:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Put the script inside a file and then use "@" in sqlplus command line to call it.

Regards
Michel
Re: Display option in sqlplus [message #451102 is a reply to message #451035] Mon, 12 April 2010 08:14 Go to previous messageGo to next message
veemani
Messages: 10
Registered: July 2009
Location: Chennai
Junior Member
Hi Michel,
Thanks for the reply, is there any other way instead of putting the sql into a file?
Re: Display option in sqlplus [message #451103 is a reply to message #451035] Mon, 12 April 2010 08:21 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can get unix to write the file instead of sqlplus:
sqlplus -s << ! >> sysdate.txt
set head off pages off trimspool on termout off
select sysdate from dual;
!


EDIT: removed spool off

[Updated on: Mon, 12 April 2010 08:22]

Report message to a moderator

Previous Topic: Oracle XMLGEN
Next Topic: SQL Output
Goto Forum:
  


Current Time: Thu Mar 28 11:00:01 CDT 2024