DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Call stored procedure from Unix Shell Script

  1. #1
    Join Date
    Nov 2000
    Posts
    224

    Question Call stored procedure from Unix Shell Script

    Can you please let me know How to call stored procedure from Unix shell script?

    Thanks!

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    Code:
    #!/bin/sh
    
     sqlplus /nolog "<<" END ">>" $LOG 2>&1
       connect sys/${SYS_PASS} as sysdba
    
       set termout off
       @$ORACLE_HOME/rdbms/admin/catalog.sql
       @$ORACLE_HOME/rdbms/admin/catproc.sql
    
    END
    Note:
    Surround the first END with double angle brackets. The forum only shows single brackets when posted, that's why there are quotation marks.
    Last edited by stecal; 12-17-2002 at 02:29 PM.

  3. #3
    Join Date
    Nov 2000
    Posts
    224
    I don't want query to display result/output when it is running from shell script. I thought set termout off will help it, but it doen't.

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    That's up to you. You can suppress the output. set serveroutput off

  5. #5
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938

    Re: Call stored procedure from Unix Shell Script

    Originally posted by Sharma
    Can you please let me know How to call stored procedure from Unix shell script?

    Thanks!
    The trend nowadays is to do it the other way around: execute OS commands from within PL/SQL :-)
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  6. #6
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588
    Originally posted by Sharma
    I don't want query to display result/output when it is running from shell script. I thought set termout off will help it, but it doen't.
    May direct it to device null..

    $ sh runme.sh /dev/null 2>&1

  7. #7
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    double quotes are not needed for >> and <<

  8. #8
    Join Date
    May 2002
    Posts
    2,645
    Originally posted by stecal

    Note:
    Surround the first END with double angle brackets. The forum only shows single brackets when posted, that's why there are quotation marks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width