SQL Spool Function - Prompt for location

SQL Spool Function - Prompt for location

Author
Discussion

eltax91

Original Poster:

9,914 posts

208 months

Thursday 7th February 2008
quotequote all
Folks,

I'm writing an sql script to count the number of records in a database so users can run the script before and after upgrades to prove that all the tables are still intact.

Obviously, these need to be spooled, but i'm having trouble figuring out how you "prompt" the user to enter a file name. So far i'm doing this:

spool c:\blah\test.txt
set echo on
several count statments
set echo off
spool off

Inplace of c:\test.txt above, is there any way in which i can force the user to enter a location themselves? The reason being is they don't have access to the the "blah" folder, or their default oracle directory...

cottonfoo

6,016 posts

212 months

Thursday 7th February 2008
quotequote all
Could they pass it as an argument then grab it via %1 ?

eltax91

Original Poster:

9,914 posts

208 months

Thursday 7th February 2008
quotequote all
cottonfoo said:
Could they pass it as an argument then grab it via %1 ?
Whoosh... how does that work? Any links to an example so i can have atry. I have a test database i can butcher here to get it working.