Home » Infrastructure » Unix » Very urgent please
Very urgent please [message #296075] Thu, 24 January 2008 08:57 Go to next message
balajisundar
Messages: 29
Registered: October 2007
Junior Member
Hi folks,

Im calling a sql script from an UNIX shell script. This particular sql script in turn calls a PL/SQL procedure inside a package. I'm now trying to pass the values that i have obtained in the SQL script back to Shell script. Could any one of you help me how this could be achieved.

I'm placing the codes for your reference

sqlplus -s XXXX/YYYY@$ABC_TOP/sql/new_oas_0069.sql
errorcode=$?
current_date_time=$?
#export LOG=$MISC/$current_date_time$SCRIPTNAME.log
export LOG=$MISC/$TEST$SCRIPTNAME.log

if [ $errorcode = 0 ]
then
echo 'new_oas_0069 has executed successfully'


new_oas_0069.sql code

WHENEVER SQLERROR EXIT 1

WHENEVER OSERROR EXIT 1

SET VERIFY OFF
SET HEADING OFF
SET FEEDBACK ON
SET TERMOUT ON
SET SERVEROUTPUT ON SIZE 25000
SET TIME ON

VARIABLE error_flag NUMBER;

VARIABLE current_date_time NVARCHAR2(100);

VARIABLE TEST NVARCHAR2(200);
BEGIN
:error_flag := 0;
:current_date_time:=null;
dbms_output.put_line(:error_flag);
test.AUTOMATION.new_oas_0069(:error_flag,:current_date_time);
dbms_output.put_line(:current_date_time);
END;
/



I want the current values of :error_flag and :current_date_time from sql script to be reflected in the shell script.

Any help in this regard is really appreciated.

Thanks,
Balaji

[Updated on: Thu, 24 January 2008 08:58]

Report message to a moderator

Re: Very urgent please [message #296086 is a reply to message #296075] Thu, 24 January 2008 09:56 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
If it is Very Urgent perhaps you should hire a consultant.
Re: Very urgent please [message #296088 is a reply to message #296075] Thu, 24 January 2008 10:02 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The only urgent thing in forum is to read OraFAQ Forum Guide.

Try to post in the correct forum maybe you'd have a faster answer.

Your previous question was "urgent please", this one is "very urgent please", I bet the next one will be "very very urgent please".

Regards
Michel

[Updated on: Thu, 24 January 2008 10:05]

Report message to a moderator

Re: Very urgent please [message #296089 is a reply to message #296075] Thu, 24 January 2008 10:10 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
http://www.orafaq.com/forum/m/259114/0/
http://www.orafaq.com/forum/t/36769/0/

So the answer is

a) google your question (Most of the time you will find an answer)
b) Search in the forum you are posting
c) If you can't find it then before you post follow the guidelines.

Regards

Raj
Re: Very urgent please [message #296091 is a reply to message #296089] Thu, 24 January 2008 10:14 Go to previous message
balajisundar
Messages: 29
Registered: October 2007
Junior Member
Hi Raj,

I have seen the thread which you given before my post but i doubt if that fits my scenario.

Thanks for your feedback

Balaji
Previous Topic: start owb mappings from unix
Next Topic: Passing arguments to Sql Loader (merged)
Goto Forum:
  


Current Time: Thu Mar 28 13:53:50 CDT 2024