Home » SQL & PL/SQL » SQL & PL/SQL » execution and compilation of a procedure and function in shell scripting
execution and compilation of a procedure and function in shell scripting [message #224965] Fri, 16 March 2007 03:20 Go to next message
donind
Messages: 95
Registered: February 2007
Member
HI,

Any once can help me in giving example for execution and compilation of a procedure and function in shell scripting.

Thanks
Re: execution and compilation of a procedure and function in shell scripting [message #224996 is a reply to message #224965] Fri, 16 March 2007 08:18 Go to previous message
rigatonip
Messages: 50
Registered: December 2005
Member
I don't have a Unix box handy to test this. I modified an old shell script to simplify it so this should be real close. Your basically redirecting the input to/from SQL*PLUS. To get the output (dbms_output or query results), you'll need to spool them to a file. This script is set up to be run with a user that is validated at the operating system level so no login was needed.

# Start SQL*PLUS in silent mode and take script input until ! character

  sqlplus -s / << ! >> test.log
    create procedure testit
    is
    begin

      dbms_output.put_line('Hello World');
 
    end;
    /

    spool test.out
    execute testit;
    spool off
    exit;
!


Here's some other examples:

http://www.oracle-base.com/articles/misc/OracleShellScripting.php
http://www.adp-gmbh.ch/ora/misc/read_sql_from_shell_script.html
http://www.injunea.demon.co.uk/pages/page210.htm

Previous Topic: A question about determining table size.
Next Topic: Trigger not working.
Goto Forum:
  


Current Time: Tue Dec 06 16:10:30 CST 2016

Total time taken to generate the page: 0.10176 seconds