Not getting the out value parameter of a DB call in the ksh file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Not getting the out value parameter of a DB call in the ksh file
# 1  
Old 01-29-2009
How to display the out parameter from a DB call in shell

Hi all

Im calling a DB procedure as foll

sqlplus -s $DB_USERID/$DB_PASSWD@$DB_NAME<<eof
var var1 VARCHAR2(200);
exec ODAS_BATCH_JOBS_RETRIEVE.retrieve_user_info(:var1);
eof

echo $var1

This echo is giving a blank.
Also in case the package ODAS_BATCH_JOBS_RETRIEVE is in an un compiled state i wanted to capture it in a variable on the basis of which i had to do further processing.

Thanks
Sam

Last edited by Sam123; 01-29-2009 at 01:16 AM..
# 2  
Old 02-03-2009
Quote:
This echo is giving a blank
That's because the sqlplus command has nothing to do with the shell. The sqlplus command might output something into :var1, but the shell knows nothing of it. You have to output the result to standard output, and capture that in a variable:

var1=`sqlplus .... `
# 3  
Old 02-03-2009
yup got that...thnks..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call script parameter based on dates

Hi Guys, I am having a script which needs to be iterated based on date passed and itrate based on no of months given. #!/bin/bash var_d=$1 months=$2 sh invoke_script var_d i need to iterate the inside script something like below sh invoke_script 170101 sh invoke_script... (4 Replies)
Discussion started by: Master_Mind
4 Replies

2. 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

3. Shell Programming and Scripting

Call Script with Parameter (that has another parameter)

Hi. How do I achieve this sh /EDWH-DMT02/script/MISC/exec_sql.sh "@/EDWH-DMT02/script/others/CSM_CKC/Complete_List.sql ${file_name}" Complete_List.txt The /EDWH-DMT02/script/MISC/exec_sql.sh has two parameters and it's working fine with this sh /EDWH-DMT02/script/MISC/exec_sql.sh... (7 Replies)
Discussion started by: aimy
7 Replies

4. UNIX for Dummies Questions & Answers

How to pass a parameter to an alias in ksh?

I want to do something like this: alias cd2="cd /data_saves/$(/opt/bin/util/getcustdb -i $@)" Where /opt/bin/util/getcustdb is an inhouse script to lookup customer db name based on a provided id number Then when I use the alias I can cd2 4567 and have it run "/opt/bin/util/getcustdb -i... (3 Replies)
Discussion started by: JourneyRider
3 Replies

5. Shell Programming and Scripting

How to call stored procedure with CLOB out parameter from shell script?

I have written a stored procedure in oracle database, which is having a CLOB OUT parameter. How can i call this stored procedure from shell script and get the CLOB object in shell script variable? (0 Replies)
Discussion started by: vel4ever
0 Replies

6. AIX

Audit problem : A system call received a parameter that is not valid.

while i try to start the audit i have the below error message . audit>audit start ** auditing enabled already A system call received a parameter that is not valid. please advice (6 Replies)
Discussion started by: thecobra151
6 Replies

7. Shell Programming and Scripting

how to call a .bat file using KSH

Hi all, I am a very new user for korn scripting and in a process of learning. i have a .bat file that calls a .vbs file which calls a macro used to convert an excel spread sheet to .csv file... Now i want to automate this process. I want to call this bat file using a korn script or a korn... (16 Replies)
Discussion started by: bhagya2340
16 Replies

8. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

9. Shell Programming and Scripting

Accessing the Value of a parameter in KSH

Hi I am new to this forum. Please forgive me, If I am wrong anywhere. I am trying to understand the below code. Can anyone help in understanding what is ${#ST} here. Is that the value of the first parameter??:confused:...what is exit 1 mean. Any clarification is greatly appreciated. export... (3 Replies)
Discussion started by: suaven
3 Replies

10. Shell Programming and Scripting

ksh parameter --- change

I am reading a file into a parameter in my program typeset nums_type if the contents of nums_type = asdfghbqwerty how do make a new paremeter eqaul to the 7th character of nums_type. like ${type} = b (2 Replies)
Discussion started by: frank
2 Replies
Login or Register to Ask a Question