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: Tom <tcarmich_at_nortelnetworks.com>
Date: Tue, 11 Dec 2001 15:56:46 -0500
Message-ID: <3C16730E.E5FB5C7@nortelnetworks.com>


WHat does

variable excode number do in the code

Just trying to understand more about oracle

"Dmitry E. Loginov" wrote:

> Play around
> sqlplus variable, exit commands
> select ... into statements
>
> You should write something like following
>
> CONNSTR="SCOTT/TIGER"
> SQLSTR="select to_number(to_char(sysdate,'SSSSS')) into :excode from dual;"
> sqlplus $CONNSTR <<EOF
> variable excode number
> $SQLSTR
> exit :excode
> EOF
>
> PS: AFAIK you can't return date as returning code in Unix, it should be
> integer
>
> "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 Tue Dec 11 2001 - 14:56:46 CST

Original text of this message

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