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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping using both oracle and shell

Status
Not open for further replies.

bhagyamurali

Technical User
May 1, 2003
4
GB
Hello everyone,

I have the following problem:

I want to select values from column a in table b and pass the value as a variable so that I can grep a file from the unix directory (based on the value a). If the file is found, then I want to move the file to another directory if not, then go onto value 2 in column a and repeat the process until all the rows are exhausted.

I would have to invoke sqlplus
select a from table b
where c=d (etc etc)

And from here I want to assign selected value a as a variable and use it to find a file.

How do I proceed? Please help...

thank you
b
 
See faq822-2218 (specifically) :

Background / Overview
SQL*Plus will happily integrate into the standard UNIX IO streams.
The simplest way to demonstrate this point is that the following UNIX command:
(Modified) :

yourvar="select a from table b where c=d (etc etc);" |sqlplus -s scott/tiger

HTH



Dickie Bird (:)-)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top