I have a script that contains many stand alone blocks of SQL. I employ a substitution variable in the WHERE clause of each SQL block.
For Example:
DEFINE regionValue="Townsville Region" --yes, there is a space in the attribute value.
Select ...
From ...
WHERE region = '&®ionValue';
[this is a simplified representation of the queries]
and this is repeated for each different query so one substitution variable is used many times.
I want to spool each query output to a seperate file. I would like to use the substitution variable in the filename. I thought this would be easy, alas I was mistaken.
The outcome I want is:
SPOOL c:\reports\Townsville Region_LEAVE.csv
and
Spool c:\reports\Townsville Region_OVERTIME.csv
and there are more.
My Question: How can I concatenate the substitution variable to form part of the filename?