RE: How to a value from sqlplus a shell variable

RE: How to a value from sqlplus a shell variable

 

  

Hope this helps... $reslt has the result from sqlplus session...


run_sql_log()
{
sqlin="$*"
reslt=$( {
echo "$sqlin"
} | tee /dev/stderr | $ORACLE_HOME/bin/sqlplus -s /nolog 2>&1 |
tee /dev/stderr )

if [[ $(print -r -- "$reslt" | egrep -c "ORA-|MGR-|TNS-|SQL-|PLS-")
-ne 0 ]]
then
return 1
fi

-----Original Message-----
From: Michael
[mailto:oracledba-ezmlmshield-x15291323.[Email address protected]
Sent: Friday, May 28, 2004 2:09 PM
To: LazyDBA.com Discussion
Subject: How to a value from sqlplus a shell variable


Anyone knows how to pass a variable in sql plus to a shell variable.
Such that after disconnecting from the database you can still access
this variable in a Unix shell

Thanks in advance for your Help



--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: send a blank email to oracledba-[Email address protected]
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------


Oracle LazyDBA home page