SQL statements inside shell script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rasmidas
    New Member
    • Jun 2007
    • 56

    SQL statements inside shell script

    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
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    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

    Comment

    Working...