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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-10-2006
u263066 u263066 is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 66
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
  #2 (permalink)  
Old 08-10-2006
Dhruva's Avatar
Dhruva Dhruva is offline
Registered User
  
 

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

Join Date: Jul 2006
Posts: 66
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
  #4 (permalink)  
Old 08-10-2006
Dhruva's Avatar
Dhruva Dhruva is offline
Registered User
  
 

Join Date: Mar 2006
Location: India
Posts: 255
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 08:03 AM..
  #5 (permalink)  
Old 08-11-2006
lchi2000 lchi2000 is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 1
#!/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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0