How to Pass the Output Values from the PL/SQL Procedure to Shell Script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to Pass the Output Values from the PL/SQL Procedure to Shell Script?
# 1  
Old 08-10-2010
How to Pass the Output Values from the PL/SQL Procedure to Shell Script?

hi,

Could anyone tell me how to pass the output values of the PL/SQL procedure to Shell script and how to store that values in a shell script variable...

Thanks in advance...
# 2  
Old 08-10-2010
There are a lot of threads regarding this topic, use the search function right above aand search for: sql shell variable
# 3  
Old 08-10-2010
Thanks for your reply franklin i used the search function and found few post but in that i couldnt find how to pass the a Input to the procedure from shell script and get two outputs to the shell script...

below is my procedure

"CREATE OR REPLACE PACKAGE BODY ECONFIG.TRAINS_MGTS
AS
PROCEDURE ALL_TRAINS (
I_CLI_CODE IN NUMBER,
CLIENT_NAME OUT VARCHAR2,
CLIENT_STATUS OUT VARCHAR2) IS

BEGIN

SELECT A.CLIENT_NAME, A.CLIENT_STATUS INTO CLIENT_NAME, CLIENT_STATUS from ECONFIG.EC_CLIENT A where A.CLI_CODE =I_CLI_CODE ;
DBMS_OUTPUT.ENABLE;
DBMS_OUTPUT.PUT_LINE('OUR REQ CLIENT NAME IS: ' || CLIENT_NAME|| ' OUR SELECTED CLIENT STATUS IS: ' || CLIENT_STATUS);
END;
END TRAINS_MGTS;/"

kindly advice...
# 4  
Old 08-10-2010
Hi

You can check the examples here for reference..connect to sqlplus and retrieve data and modify your criteria accordingly.

Guru.
# 5  
Old 08-11-2010
thanks a lot guruprasad now i am able to establish connection with sqlplus but i am still not able to store the values of the procedure in a shell script variable...
# 6  
Old 08-11-2010
Hi
Please provide us with what you have tried till now to help you better.

Guru.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Emailing results of a pl sql procedure from UNIX shell script

Hello All, I am writing the below unix script to email the result of a small pl sql procedure: #!/bin/bash ORACLE_HOME=/opt/oracle/orcts/product/9.2.0; export ORACLE_HOME SQLPLUS=$ORACLE_HOME/bin/sqlplus sqlplus -s user/pass@Db_instance<<EOF set echo off set feedback off set pages 0... (9 Replies)
Discussion started by: Bunty bedi
9 Replies

2. Shell Programming and Scripting

Unable to pass value from .Shell script to .SQL file

Hi All, I am new to shell script. I am trying to pass value from .sh file to .sql file . But I am able to run the .sql file from .sh file with values in sql file. But I am unable to pass the values from .sh file. can some one please help to resolve this. here is my .sh file s1.sh ... (4 Replies)
Discussion started by: reddy298599
4 Replies

3. Shell Programming and Scripting

How to pass Oracle sql script as argument to UNIX shell script?

Hi all, $ echo $SHELL /bin/bash Requirement - How to pass oracle sql script as argument to unix shell script? $ ./output.sh users.sql Below are the shell scripts and the oracle sql file in the same folder. Shell Script $ cat output.sh #!/bin/bash .... (7 Replies)
Discussion started by: a1_win
7 Replies

4. Shell Programming and Scripting

calling pl/sql procedure from shell and return values

How could I call an Oracle PL/SQL procedure from any shell (bash) and catch returning value from that procedure (out param) or get a returning value if it's a function. also, I got into trouble when I tried to send a number as a param #!/bin/bash -e username=$1 pwd=$2 baza=$3... (0 Replies)
Discussion started by: bongo
0 Replies

5. Shell Programming and Scripting

how to pass the values to unix shell from the oracle stored procedure.

Hi i am calling a stored procedure from unix shell like this call test_proc('0002','20100218'); the stored procedure was giving output like this dbms_output.put_line(' processed earlier'); i want to see the output in the unix shell where i called. Thanks barani (6 Replies)
Discussion started by: barani75
6 Replies

6. Shell Programming and Scripting

how to store the return values of stored procedure in unix shell script.

hi i am calling a oracle stored procedure(in the database) from unix shell scripting (a.sh). the called stored procedure returns some values through OUT variables i want to assign the return values of stored procedure in to unix shell script variable. can you provide me the code. ... (1 Reply)
Discussion started by: barani75
1 Replies

7. Shell Programming and Scripting

How to pass pl/sql table values to shell script

Hello, i am using '#!/bin/bash', i want to make a loop in pl/sql, this loop takes values from a table according to some conditions, each time the loop choose 3 different variables. What i am not able to do is that during the loop i want my shell script to read this 3 variables and run a shell... (1 Reply)
Discussion started by: rosalinda
1 Replies

8. Shell Programming and Scripting

How to pass parameter from sqlplus(procedure completed) to your shell script

if then # mail -s "Import failed file does not exist" sanjay.jaiswal@xyz.com echo "FILE does not exist" exit 1 fi echo "FILE EXIST" size=-1 set $(du /export/home/oracle/nas/scott21.dmp.gz) while do echo "Inside the loop" size=$1 set $(du... (1 Reply)
Discussion started by: sanora600
1 Replies

9. Shell Programming and Scripting

need help on shell script(to pass the values)

only the arguments that are written to the file, my script is (sh /u01app/wkf.sh"$start_no","$name","$Condition","$file_name") like that when ever I run my script I need to write into a new file every time, like wise I have upto10 files with different names.bec my $start_no and $name will... (1 Reply)
Discussion started by: sai123
1 Replies

10. UNIX for Dummies Questions & Answers

how to pass values from oracle sql plus to unix shell script

how to pass values from oracle sql plus to unix shell script (2 Replies)
Discussion started by: trichyselva
2 Replies
Login or Register to Ask a Question