Reurning Oracle Proc out parameter


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Reurning Oracle Proc out parameter
# 1  
Old 03-24-2009
Reurning Oracle Proc out parameter

Hi. I need sime help with a unix script. The script runs a Oracle Procedure which then runs
some child procedures which are autonomous.
When the child procedures fail, the sql error is not passed back to the parent procedure -
i.e all the othert child procedures run.
I want to execute the parent proc using a unix script and capture the fact that a child proc
has failed. I do this by returning a status code of 0 or -1 from the child proc and use that
in teh parent proc to determine a failure. I need to capture this out parameter from
the parent proc and pass it to a Unix variable.
My sample code is below:

#! /usr/bin/ksh
export ORACLE_HOME=/apps/oracle/product/10.2.0.4
export ORACLE_SID=test
cd $ORACLE_HOME/bin
sqlplus user/pwd@$ORACLE_SID << END_OF_SQL
whenever sqlerror exit 1
set serveroutput on;
DECLARE
P_RUNDATE DATE;
v_STATUS DATE;

begin
P_RUNDATE := TO_DATE('$1','DD/MM/YYYY');
PKG_TEST.TEST2(P_RUNDATE => P_RUNDATE,P_STATUS => v_STATUS);
end;
/
exit;
END_OF_SQL
$retcode=$?
echo $retcode
print end

Any help will be appreciated.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Passing output parameter(Oracle) to variable in ksh Script

Hello, I have researched and tried many way to pass OUT parameter to be stored in variable in KSH Script.Still not success, please help. Here is my Store Procedure. create procedure testout3(v_in varchar2,v_out OUT integer) as begin v_out := 1; end; Here is my testvout.ksh #!/bin/ksh... (1 Reply)
Discussion started by: palita2601
1 Replies

2. Shell Programming and Scripting

parameter issue in oracle shell script

Hi All, I am new to this code and shell scripting. I have code like below CREQID=`echo $* | awk '{gsub(/"/, ""); print$9}'` REQID=$3 echo CREQID=$CREQID I have another parameter added to the report/program(interchanged) 1st one is now, order_no, 2nd one is CREQID. Now if... (2 Replies)
Discussion started by: Mist123
2 Replies

3. Shell Programming and Scripting

Parallel execution of Oracle PROC in UNIX

Hi, Trying to run the Oracle Proc in parallel, but not working.. below code runs each call of the procedure and its coming out of the loop before its completion and printing the last statement! not waiting for the sqlplus to complete. for name in `cat abc.txt` do (sqlplus -s ... (3 Replies)
Discussion started by: ATWC
3 Replies

4. Shell Programming and Scripting

To call Oracle procedure by reading parameter file in UNIX

hi Guys, is there a way to pass parameter into oracle store procedure by reading date range in file and increment accordingly. Something like this file.txt 01-JAN-2015 03-JAN-2015 sqlplus -s user/pwd@DB execute TEST( to_date( '01-JAN-2015, 'dd.mm.yyyy' ), to_date( '03-JAN-2015', ... (1 Reply)
Discussion started by: rohit_shinez
1 Replies

5. Shell Programming and Scripting

Command that takes one parameter and then searches for the passed in parameter

Hi I am looking for a unix command or a small shell script which can takes one parameter and then searches for the passed in the parameter in any or all files under say /home/dev/ Can anyone please help me on this? (3 Replies)
Discussion started by: pankaj80
3 Replies

6. Programming

how to obtain a persistent oracle connection in proc*c pthread

Hi all, I have problem to set up a persistent oracle connection in child thread. We have a massive batch process dealing with large data. Application was written and impossible to be rewritten. I am trying to extract the most time consuming data fetching and put it into a dedicated child... (3 Replies)
Discussion started by: ora-dev
3 Replies

7. UNIX for Dummies Questions & Answers

Help Passing An Oracle parameter to a unix shell.

I have an Oracle concurrent program that I'm passing a parameter to a unix shell script. An example value of the Oracle parameter is PO_TOP. The Oracle parameter represents the unix env var PO_TOP, meaning, on the unix side there is env var called PO_TOP (ex value: /oradev/apps/po/11.0.3/). My... (7 Replies)
Discussion started by: Mark_Wright
7 Replies

8. UNIX for Dummies Questions & Answers

_/proc/stat vs /proc/uptime

Hi, I am trying to calculate the CPU Usage by getting the difference between the idle time reported by /proc/stat at 2 different intervals. Now the 4th entry in the first line of /proc/stat will give me the 'idle time'. But I also came across /proc/uptime that gives me 2 entries : 1st one as the... (0 Replies)
Discussion started by: coderd
0 Replies

9. Shell Programming and Scripting

Unix call to Oracle PL/SQL pkg/store.proc

HI, I'm trying to get this right, please can you help. In my unix korn shell script, I call an oracle stored proc within a package and I specify 3 parameters, 2 of which are IN OUT parameters (i.e. I expect the stored proc to change them and return them back to me). Does the unix code... (7 Replies)
Discussion started by: csong2
7 Replies

10. Shell Programming and Scripting

how do I make dynamic parameter names? Or get the value of a parameter evaluated twi

Say I write something like the following: var1=1 var2=2 for int in 1 2 do echo "\$var$int" done I want the output to be: 1 2 Instead I get something like: $var1 $var2 (2 Replies)
Discussion started by: Awanka
2 Replies
Login or Register to Ask a Question
DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)	User Contributed Perl Documentation	  DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)

NAME
DBIx::Class::Storage::DBI::Oracle::WhereJoins - Oracle joins in WHERE syntax support (instead of ANSI). PURPOSE
This module is used with Oracle < 9.0 due to lack of support for standard ANSI join syntax. SYNOPSIS
DBIx::Class should automagically detect Oracle and use this module with no work from you. DESCRIPTION
This class implements Oracle's WhereJoin support. Instead of: SELECT x FROM y JOIN z ON y.id = z.id It will write: SELECT x FROM y, z WHERE y.id = z.id It should properly support left joins, and right joins. Full outer joins are not possible due to the fact that Oracle requires the entire query be written to union the results of a left and right join, and by the time this module is called to create the where query and table definition part of the SQL query, it's already too late. METHODS
See DBIx::Class::SQLMaker::OracleJoins for implementation details. BUGS
Does not support full outer joins. Probably lots more. SEE ALSO
DBIx::Class::SQLMaker DBIx::Class::SQLMaker::OracleJoins DBIx::Class::Storage::DBI::Oracle::Generic DBIx::Class AUTHOR
Justin Wheeler "<jwheeler@datademons.com>" CONTRIBUTORS
David Jack Olrik "<djo@cpan.org>" LICENSE
This module is licensed under the same terms as Perl itself. perl v5.18.2 2013-07-12 DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)