Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: calling pl/sql function from unix shell script

Re: calling pl/sql function from unix shell script

From: Ranga Chakravarthi <ranga_at_cfl.rr.com>
Date: Wed, 12 Dec 2001 19:22:28 GMT
Message-ID: <U7OR7.79289$Ga5.12311943@typhoon.tampabay.rr.com>


set m_var `sqlplus -s uid/pw @script.sql` (be careful to use the 'evaluation' back-quotes: `...`) where script.sql looks something like:
set feedback off
set pagesize 0
set linesize xxx
set trimspool on
ttitle off
btitle off
set verify off
select sysdate
from dual
/
exit
echo ${m_var}

please check syntax before you run.

HTH,
Ranga Chakravarthi

"Patrick" <P_swiggers_at_yahoo.com> wrote in message news:3b58c6c3.0112110940.3f5e71f2_at_posting.google.com...
> I want to call a pl/sql function from a unix shell script and get the
> return value. This is how I use sql from within a script:
> SQL_STR="select sysdate from dual;"
> echo ${SQL_STR} | sql
> echo $?
> How can I do the same thing but calling a pl/sql function and getting
> the returned value?
>
Received on Wed Dec 12 2001 - 13:22:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US