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 Oracle Stored Procedure from Shell Script

Re: Calling Oracle Stored Procedure from Shell Script

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 24 Jun 2005 02:33:41 -0700
Message-ID: <1119605620.969323.27570@g14g2000cwa.googlegroups.com>

beenamore_at_gmail.com wrote:
> Hi,
>
> I have a stored procedure proc1(param1 in varchar2, param2 in
> varchar2). I have tested this one and it works fine.
>
> I need to call this procedure from a shell script. I am using
>
> sqlplus -S ${ORACLE_USER}/${ORACLE_PASSWORD}@${ORACLE_CONN}
> @${INSTALL_ROOT}proc.sql
>
> and proc.sql is
> begin
> exceute proc1('param1','param2');
> end;
>
> When I execute the above, the shell script just hangs. Can anyone tell
> me the correct way of calling a stored procedure from sh program?
>
> Thanks for your help,
> Beena

begin

   proc1('param1','param2');
end;
/
exit

In the above, removed execute... execute means begin end; and is a SQL*Plus command which has no meaning inside PLSQL block thus resulting in error. There is an "execute immediate" inside PLSQL but I don't think that is what you mean here.
Also added / to terminate PLSQL block (Most likely the cause of hang) and exit as suggested by other poster.

Regards
/Rauf Received on Fri Jun 24 2005 - 04:33:41 CDT

Original text of this message

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