Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Calling stored procedure from unix shell script

834459Feb 8 2011 — edited Feb 8 2011
Hello,
I am facing a problem while calling a stored procedure from UNIX shell script. I want to return a output variable from the stored procedure to the UNIX environment.
Here is the code-

#!/bin/sh

OUTPUT=`sqlplus cmag/magnum@dw <<ENDOFSQL
set serveroutput on;
var prd_out varchar2(100);
exec create_pm_window(:prd_out);
exit;
ENDOFSQL`

echo " output is - $OUTPUT"

The problem is :prd_out is not getting copied to shell variable OUTPUT.
I have a dbms_output.put_line in the stored proc create_pm_window and I can see that prd_out is getting populated.

Any help is really appreciated.
Thanks'
Rakhee
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2011
Added on Feb 8 2011
5 comments
20,313 views