How to pass pl/sql table values to shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to pass pl/sql table values to shell script
# 1  
Old 08-21-2008
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 script.
Here is a clarification:

My pl/sql is:
-----------------------------------------------------------------------
DECLARE
gn_bossid NUMBER(38);
gn_bossaccountid NUMBER(38);
gn_bossaddress NUMBER(38);
gn_voip_directoraddress NUMBER(38);
value1 NUMBER(38);
value2 NUMBER(38);
value3 NUMBER(38);

BEGIN

FOR voip_cparty IN (SELECT V.boss_id, V.bossaccount_id, V.bossaddress
INTO gn_bossid, gn_bossaccountid, gn_bossaddress
FROM Tbossesdata V
WHERE STATE IN ('A')
)
LOOP
BEGIN
value1 := gn_bossid;
value2 := gn_bossaccountid;
value3 := gn_bossaddress;

(1- here i want the shell to read this values
2- Call this same script to perform some other actions according to this values)

END;
END LOOP;
END;
---------------------------------------------------------------------------------------------------

I want the values value1, value2, and value3 to be readen by a shell script inside the loop where the loop is searching and calling the script to run.

what commands should be written in pl/sql and shell to perform this?

I appreciate your kind help.
Thanks!
# 2  
Old 08-21-2008
There is no simple way to do it (unless you want to try some SQLJ procedures etc. which may be able to call an external program - I havn't explored that).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

4. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

5. Shell Programming and Scripting

Pass values from web form to shell script

Hi, is it possible to pass more values from web form like textbox to shell script and if yes,how to do that.:confused::confused::confused: (2 Replies)
Discussion started by: tdev457
2 Replies

6. Shell Programming and Scripting

How to get full sql table data using shell script

i have a Oracle table like col1 col2 ---- ----- a 1 b 2 c 3 when i write a script for it , it gives me all the data in one column. Please give me the solution which gives the exact result like we see in sql editors. for a in `echo " set feedback off; set pagesize 40;... (1 Reply)
Discussion started by: ss135r
1 Replies

7. Shell Programming and Scripting

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... (5 Replies)
Discussion started by: funonnet
5 Replies

8. Shell Programming and Scripting

How to pass arguments to SQL file passed in shell script?

Hi, I am using SYBASE database. in my script i am connecting to DB via using isql. isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
Discussion started by: dazdseg
3 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