Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO CAPTURE the Output of SQL in unix shell script

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a very unique problem i want to capture the output from a sql command which returns only one rec in shell script
Any suggestion would be appreciated
 
write mysql.sql

spool my.sh

select 'grep '||mytable.value|| ' *' from mytable where value = selection;

spool off

now call a doit.sh which does
...
sqlplus -s user/pass @mysql.sql
chmod 777 my.sh
my.sh
.... I tried to remain child-like, all I acheived was childish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top