![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 03:06 AM |
| Values of value($$X) in unix shell script | ganesh_111 | Shell Programming and Scripting | 5 | 09-22-2006 06:25 AM |
| Passing Values from a shell script | dhananjaysk | Shell Programming and Scripting | 6 | 04-06-2006 09:33 AM |
| Passing Parameters and getting values back from a c program to Shell script | Rajeshsu | High Level Programming | 5 | 08-22-2005 03:12 AM |
| Returning Values (shell Script) | jennifer01 | Shell Programming and Scripting | 3 | 11-29-2001 06:31 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
passing values from sql to shell script
Hi guyz,
Posting a thread after a long time. I want to pass two variables to unix shell script from sql script. Note: I am calling sql script from unix script. sql script has 2 variables one is the return code for status of program run and second one email flag. I don't know how to capture email flag in unix. |
|
||||
|
Hey dude, this question was asked before.. kindly check the replies for the same.
Anyways posting the reply..... RETVAL=`sqlplus -s user/pwd@host <<EOF SET SERVEROUTPUT ON SIZE 100000 Declare OUT_MSG VARCHAR2(200); Begin select name into OUT_MSG from table_success; dbms_output.put_line ('KeepThis '||nvl(OUT_MSG,'')); End; / SET SERVEROUTPUT OFF EXIT; EOF` X=`echo $RETVAL | grep KeepThis | awk '{print $2}'` Y=`echo $RETVAL | grep KeepThis | awk '{print $3}'` Z=`echo $RETVAL | grep KeepThis | awk '{print $4}'` echo "The Query output is: " echo "Query OUT_MSG 1= $X " echo "Query OUT_MSG 2= $Y " echo "Query OUT_MSG 3= $Z " If you have more outputs from query, print those results in $5, $6,...... |
|
||||
|
Hi!
here is the sql statement within shell script --------- --------- sqlplus system/manager@SID @myreport myreport passes 3 values so how should i store it in a varibale. i know i have to use array but i dont know how to use it. Regards, Sachin |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|