If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Parameter passing from PL*SQL to Unix shell script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-04-04, 13:49
dbforums_ajayp dbforums_ajayp is offline
Registered User
 
Join Date: Feb 2004
Posts: 11
Question Parameter passing from PL*SQL to Unix shell script

I am calling a PL*SQL from Unix shell script using 'sqlplus' command.

While doing so I am also passing parameters to the PL*SQL.

Is it possible to return a value from PL*SQL to the Unix shell script ?
__________________
Regards,

Ajay Patel
Reply With Quote
  #2 (permalink)  
Old 02-04-04, 16:37
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
A possible solution (for oracle) :

In your PL*SQL script (pl.sql):
set serveroutput on
BEGIN
. . .
dbms_output.put_line('RETURN_VALUE');
. . .
END

In your shell :
value=`sqlplus xx/xx @pl.sql`
__________________
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 02-18-04, 08:15
amarpd amarpd is offline
Registered User
 
Join Date: Feb 2004
Location: UK
Posts: 1
Smile

The below script shows how to return values from PL/SQL block

variable a_var number
declare
var1 number;
begin
UPDATE EMPLOYEE
SET NAME = &1
WHERE EMP_ID= '&2';
var1 := SQL%ROWCOUNT;
IF var1 >= 1 THEN
:a_var := 0;
ELSE
:a_var := 1;
END IF;
end;
/
exit :a_var
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On