Hi I'm trying to execute PL SQL Procedure from my Shell Script and get the return value (out value), but it's not working. Can anyone advise what I'm doing wrong? Here's what I have:
output="$(sqlplus -S user/pw@//ip:1521/db <<ENDOFSQL
set serveroutput on;
DECLARE
v_return PLS_INTEGER;
BEGIN
PKG.Procedure(v_return);
DBMS_OUTPUT.PUT_LINE(v_return);
END;
exit;
ENDOFSQL)"
echo $output
PKG.procedure(v_return)and replacing it with something static; set it it 1 or something and see if you get some output that way then we can say the issue is with the package.