Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Showing results for 
Search instead for 
Did you mean: 

To repeat a query

Vincenzo Restuccia
Honored Contributor

To repeat a query

I want to repeat this query 295 times and I have the name "variable" in a file or in a db table. I want a PL/SQL script.

select * from nas where name='variable'

Sridhar Bhaskarla
Honored Contributor

Re: To repeat a query


A DBA may answer your question better.

Meanwhile, this is what I did for my cgi's.

sql_file contents

select * from table where name="REPLACE_THIS"

Following is the CGI

VAR=$1 #an example of assigning a variable
sed 's/REPLACE_THIS/,/'$VAR'/' sql_file > /tmp/sql$$

/tmp/sql$$ #run the sql script

rm /tmp/sql$$


You may be disappointed if you fail, but you are doomed if you don't try
harry d brown jr
Honored Contributor

Re: To repeat a query

Have you thought about using perl?

and a library of perl docs :

live free or die
Live Free or Die