Home » Other » Client Tools » Executing SQL statement for UNIX script
Executing SQL statement for UNIX script [message #460177] Thu, 10 June 2010 01:36 Go to next message
srilaxmi
Messages: 16
Registered: June 2007
Location: hyderabad
Junior Member
Hi,

I am executing the SQL statement in a unix korn shell script. and the output of this SQL is stored in a file.

 `sqlplus -S $OraUserID@$OraInstance/$OraUserPW    <<endofsql >result
         set heading off;
         SELECT * from emp;
         exit;
         endofsql`

cat result


this code working fine and the output i see in file is as below.

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Jun 9 23:09:33 2010

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release <number> - 
and Real Application Testing options

SQL> SQL> 
30-APR-10
01-MAY-10
02-MAY-10
03-MAY-10
04-MAY-10
05-MAY-10
06-MAY-10
07-MAY-10

8 rows selected.

SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 
and Real Application Testing options


How can to get only the SQL output in the file but not all the other oracle connecting messages.

Thanks,
Sri
Re: Executing SQL statement for UNIX script [message #460189 is a reply to message #460177] Thu, 10 June 2010 02:07 Go to previous message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
OraFAQ Forum offers the Search feature. Learn how to use it, as you'll get answers to most questions by simply reading what's already been said.

One of pages returned was this one; check what settings have to be set in order to get a desired result.
Previous Topic: Connection from Oracle SQL Developer to MS SQL Server
Next Topic: Problems during binding SpotLight to the instance
Goto Forum:
  


Current Time: Fri Mar 29 10:24:16 CDT 2024