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 07-01-2009
rdhanek rdhanek is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 74
how to use data in unix text file as input to an sql query from shell

Hi,
I have data in my text file something like this.

Code:
adams
robert
ahmed
gibbs

I want to use this data line by line as input to an sql query which i run by connecting to an oracle database from shell.
If you have code for similar scenario , please ehlp.
I want the output of the sql query to be updated into a text fiel so that i can mail the same as a report.
output expected :

Code:
Name   subject  marks
adams  maths   79
Robert Sceience 67
gibbs   maths    81

Thanks in advance

Last edited by Yogesh Sawant; 07-01-2009 at 08:37 AM.. Reason: added code tags