Connecting Tech Pros Worldwide Help | Site Map

SQL statements inside shell script

Member
 
Join Date: Jun 2007
Posts: 48
#1: Oct 12 '08
Hi,

I have written a shell script, in which I am connecting to the oracle database and doing some manipulation. while I am running the script, its showing me the messages I am displaying in the script as well the Oracle messages. But I dont want to display the oracle messages. Please let me know how to do this. Here I am pasting the output

dpdcs5:/home/rd31424/DBAScript $ ./newAdmMenu.sh
Enter the connect string [Ex. username/password@comsys_d1] : rd31424/smile123@comsys_d1
Enter User login ID : cc12345

SQL*Plus: Release 10.2.0.2.0 - Production on Sun Oct 12 18:29:25 2008
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> SP2-0734: unknown command beginning "#set echo ..." - rest of line ignored.
SQL> Connected.
SQL> SQL> 2 3 4
'USEREXISTS
-----------
user exists
SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
User to be created, is already exists
dpdcs5:/home/rd31424/DBAScript $



But I want the output as below:

dpdcs5:/home/rd31424/DBAScript $ ./newAdmMenu.sh
Enter the connect string [Ex. username/password@comsys_d1] : rd31424/smile123@comsys_d1
Enter User login ID : cc12345
User to be created, is already exists
dpdcs5:/home/rd31424/DBAScript $


Please help me.
gpraghuram's Avatar
Expert
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,256
#2: Oct 13 '08

re: SQL statements inside shell script


Can you post the script where you connect to db and run the query?
I think you have a comment in that sql part with # which is wrong.


Raghu
Reply


Similar Unix / Linux / BSD bytes