|
|
Re: How to write a shell script to exec a proc with in and out params and also it has default valu [message #231353 is a reply to message #231095] |
Mon, 16 April 2007 12:49 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
#!/bin/ksh
#======================================================
# stored proc with parms
#======================================================
## CREATE OR REPLACE PROCEDURE p1 (i_parm IN NUMBER, o_parm OUT NUMBER)
## IS
## BEGIN
## o_parm := 5 * i_parm;
## END;
## /
my_in_parm=5
RETVAL=`sqlplus -s scott/tiger@dev <<EOF
set serveroutput on
WHENEVER SQLERROR EXIT sql.sqlcode
declare
x number := $my_in_parm;
y number;
begin
p1(x, y);
dbms_output.put_line('o_parm from p1 is '||y);
end;
/
exit sql.sqlcode;
EOF`
echo $RETVAL
X=`echo $RETVAL | awk '{print $5}'`
echo $X
[Updated on: Mon, 16 April 2007 12:49] Report message to a moderator
|
|
|