0

Basically, I have an excel sheet with numerous select statements; wondering what's the quickest way to run all these and return the data to a file or query analyzer result window.

These are really simple select statements, they are basically

SELECT A, B, C FROM VIEW WHERE ID = '00001'

but there are about 200 hundred of these so I am wondering what's a fast way to run these

1 Answer 1

1

If you simply want to run them all in succession, and save the output, you can do something like this:

Copy them to a plain text file, call it my_queries.sql, then add a line at the top that says:

spool my_queries.lst

and then add a line to the end of the file:

spool off

Then you can connect via SQL*plus:

sqlplus username/password@your_connect_string

and then run the script with:

SQL> @my_queries.sql

You'll end up with all the results in the spool file, my_queries.lst.

Hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.