The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing more than one argument in a function jisha Shell Programming and Scripting 1 04-23-2008 03:05 AM
passing argument into awk prkfriryce Shell Programming and Scripting 4 02-01-2007 12:44 PM
Problem with Argument Passing A_Rod Shell Programming and Scripting 4 09-13-2006 08:47 AM
Thread Argument Passing narom High Level Programming 2 01-19-2006 09:10 AM
Passing argument from one script to other lloydnwo Shell Programming and Scripting 3 10-27-2005 11:06 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-02-2008
Registered User
 

Join Date: Apr 2007
Posts: 44
Passing argument to a pl/sql block

Hi,

How can I pass an argument to a pl/sql block through perl/unix shell scripting.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-02-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,502
shell script version:
Code:
var="42"
printf  "'%s'" "THIS IS A STRING" | read string_var
sqlplus -s user/passwd@somedb <<EOF
DECLARE
    mynum NUMBER(4):=$var;
    mystring VARCHAR2(32):=$string_var;
BEGIN
    UPDATE MYTABLE
          SET FLD1=mystring WHERE FLD2=mynum;
    COMMIT;
END;
/
EOF
perl has a DBI package for Oracle that allows you code what amounts to a PL/SQL script in perl.
Reply With Quote
  #3 (permalink)  
Old 05-02-2008
Registered User
 

Join Date: Apr 2007
Posts: 44
What if I have a file ex.txt with contents

23423
5645
45646
567567
56756
5675
567567
345345

and I want to pass each of these as an argument (ARG_I_ORD_KEY) to PL/SQL block.

DECLARE
RetVal INTEGER;
ARG_I_ORD_KEY NUMBER;

BEGIN
ARG_I_DOC_KEY := NULL;

RetVal := DBPROD.PILOT_Subdoc_Mgr.ONLINEORDAPPROVED ( ARG_I_ORD_KEY );
END;
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0