The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-21-2007
debu debu is offline
Registered User
  
 

Join Date: May 2007
Posts: 10
storing database query in a variable

I am executing a SQL query in Unix Server:
select status,location from user_information where request_id='DS-43720'

In shell script I am writing this query in the below manner:

echo "select status,location from user_information where request_id='DS-43720' ;" >> $directory/info.sql

//(here $directory is my home folder in Unix Server)

echo "EXIT" >> $directory/info.sql

sqlplus -s $sUserId/$sUserPassword@$ORACLE_SID @$directory/info.sql 1>>$directory/info.log 2>>$directory/info.log

Now how do I store those two column values returned in Sql query in a Unix Variable??