Sql*Plus in Shell Script Question

From: Venki Ramachandran <venkir_at_pacbell.net>
Date: Tue, 07 Aug 2001 11:16:25 -0700
Message-ID: <3B703079.B4E6646E_at_pacbell.net>


Hi,

[Quoted] I have a shell script as follows:

[Quoted] #!/bin/sh

MYNAME='Joe'; export MYNAME

sqlplus user/password -S <<File
Define v_name=$MYNAME

execute some_proc('&v_name', v_totalrecords);

File

The problem is that the variable MYNAME gets passed successfully, but the procedure does not execute because of the second variable 'v_totalrecords. It is an 'IN/OUT' variable and it needs to be DECLARED. It works in sqlplus prompt as in:

sqlplus>declare
> v_totalrecords number
>BEGIN
> v_total_records := null;
>execute some_proc('Joe', v_totalrecords);
> END;
>/

Procedure completed successfully.

The problem is how do you declare an 'IN/OUT' variable in sqlplus inside a shell script. I have tried different variations, but have been unsuccessful. The moment I put the above declare, begin and end statements around the exeute statement, it does not run or the messages do not show up. Any help will be appreciated. Thanks. Received on Tue Aug 07 2001 - 20:16:25 CEST

Original text of this message