|
|
|
|
Re: can we force a paramter value to change the filename for every execution of sql script [message #540605 is a reply to message #540598] |
Tue, 24 January 2012 13:17 |
|
dora
Messages: 13 Registered: January 2012
|
Junior Member |
|
|
Sir,
My question is,
The spooled file,ie., the filename should explain me what data it contains.
my select query within the spool script looks like this:
SPOOL C:\Programs\DATA&year..txt
select sno,name,school_id,
(select person_data from school
where to_date('&1','mm/dd/yyyy') between person_start_date
and person_end_date and person_age = 21 and county_id = T1.county_id),
(select person_data from school
where to_date('&1','mm/dd/yyyy') between person_start_date
and person_end_date and person_age = 22 and county_id = T1.county_id),
...............
from main T1,.......
SPOOL OFF;
Now i execute it in SQL*Plus worksheet like this
@'C:\Documents and Settings\Dora\SchoolInformation' 01/01/2005;
means &1 within the select query is substituted with 01/01/2005.
The file contains information such as
sno name school_id person_data
So when i look at the file, I dont know which year's data this file contains, if i give a fixed filename
Instead if i can generate a file with filename which contains year (2005) for 2005 data, its easy for me to know that the file generated contains 2005 data in it.
Hope someone understands what I am looking for, Pls help me, in creating the filename with the year I mention as parameter.
Thank You
|
|
|
|
|
|
|
|
|