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
Pass parameter into script alfredo Shell Programming and Scripting 2 04-08-2008 06:40 PM
how can i pass parameter with spaces to csh script umen Shell Programming and Scripting 1 03-19-2008 08:33 AM
PASS parameter to AWK unisam UNIX for Dummies Questions & Answers 2 05-14-2004 06:51 AM
Pass Parameter to Another Script rvprod UNIX for Dummies Questions & Answers 4 04-05-2002 09:07 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-10-2006
Registered User
 

Join Date: Jul 2006
Posts: 66
Stumble this Post!
Help required to pass the parameter

i am calling a pl/sql procedure through a shell script, there is one IN and 2 OUT parameter required to pass to the procedure to execute..

My procedure is XX_CITIDIRECT_EXP_PKG.main_proc and In parameter is p_period which I wanto to pass 'MAY-06'.

Can anyone figure out, whats is wrong here

HTML Code:
#!/bin/ksh
setenv TSTAMP1 "'MAY-06'"
sqlplus -silent apps/apps <<EOF
variable p_period varchar2
variable l_errbuf varchar2
variable l_errcode varchar2
execute XX_CITIDIRECT_EXP_PKG.main_proc(p_period =>$TSTAMP1,errbuf => :l_errbuf,retcode => :l_errcode);
exit;
EOF
Thanks in advanec
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-10-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
Stumble this Post!
in function or procedure unix variables should be passed like '$valiable_name'
not $variable_name.Try this
Reply With Quote
  #3 (permalink)  
Old 08-10-2006
Registered User
 

Join Date: Jul 2006
Posts: 66
Stumble this Post!
Help required to pass the parameter

then could you tell me then how the MAY-06 will be passed in present case

execute XX_CITIDIRECT_EXP_PKG.main_proc(p_period =>'MAY-06',errbuf => :l_errbuf,retcode => :l_errcode);

but this is erroring out
Reply With Quote
  #4 (permalink)  
Old 08-10-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
Stumble this Post!
Can you run in this way and make sure the same block is getting executed in sqlplus without error.If you get any error then paste it here.

Code:
sqlplus -silent apps/apps <<EOF
DECLARE
p_period         VARCHAR2;
l_errbuf         varchar2;
l_errcode        varchar2;

BEGIN
XX_CITIDIRECT_EXP_PKG.main_proc(p_period =>'MAY-06',errbuf => :l_errbuf,retcode => :l_errcode);
END;
/
EXIT;
EOF
and passing parameter as unix variable add this statement in shell script
x=`echo "'MAY-06'"`
and when you call that procedure pass value as p_period =>'$x'

Last edited by Dhruva; 08-10-2006 at 04:03 AM.
Reply With Quote
  #5 (permalink)  
Old 08-11-2006
Registered User
 

Join Date: Aug 2006
Posts: 1
Stumble this Post!
#!/bin/ksh

TSTAMP1="'MAY-06'" <=== The problem is right here

sqlplus -silent demo/demoyou12@ctrmad1 <<EOF
variable p_period varchar2
variable l_errbuf varchar2
variable l_errcode varchar2
execute XX_CITIDIRECT_EXP_PKG.main_proc(p_period =>$TSTAMP1,errbuf => :l_errbuf,retcode => :l_errcode);
exit;
EOF
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:02 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