Hi,
The problem am facing is according to the below example
column col1 new_value myfile noprint
select to_char(sysdate,'YYYYMMDD') col1 from dual;
---------------------------
(If I use single &, then I get on my c:\ file name as &myfile.txt)
spool c:\&myfile.txt
.
.
spool off
---------------------------
---------------------------
(If I use double &&, then I get on my c:\ file name as &20031230.txt)
spool c:\&&myfile.txt
.
.
spool off
---------------------------
I don't know what part I am missing, what I should perform in order to get the the proper file name like 20031230.txt
It looks to me as if the \ is acting as an "escape" character, preventing the following & being interpreted as the "define" character. What happens if you do a "set escape off" first?
You can use the escape character before the substitution character (set through SET DEFINE) to indicate that SQL*Plus should treat the substitution character as an ordinary character rather than as a request for variable substitution.
I don't fully follow Gregg's example - but it avoids the problem because the & does not follow the \.
Bookmarks