Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Help, please. Unneeded variable replacement verbiage spooled to output file.
I'm very much a newbie at SQL*Plus. I've been working on something
for the last couple of days that would probably be easy for most of
you, but I would certainly appreciate any help someone will give me.
I have created a query (.sql) file that I run from a batch that calls SQL*Plus. Rather than explain it, I have the query below:
column filename_column new_value filename
column today_column new_value today
column backday_column new_value backday
SELECT
to_char(sysdate,'yymmdd') || '.txt' filename_column,
to_char(sysdate-1,'dd-MON-yy') today_column,
case to_char(sysdate,'DY') when 'MON' then to_char(sysdate-3,'dd-MON-
yy') else to_char(sysdate-1,'dd-MON-yy') end backday_column
FROM dual;
spool &filename
SELECT
x.city,
x.state
FROM Patientmedicalrecords x
WHERE
x.apptdate between '&backday' and '&today';
spool off
exit
I know that it doesn't seem useful, but I cut out 'stuff' that isn't pertinant to the question.
Anyway, this works great, except that the file that is output contains two lines at the beginning that show how the variables, backday and today, have been replaced. I'd really rather not have that showing in the export file. Following is an example of the lines I'm seeing that I don't need in the file (starting with 'old 37:' and 'new 37:'):
Is there an SQL*Plus setting that I can change so that such verbiage isn't spooled? Or, are their other options that I haven't learned yet that would make setting the dates in the second query's WHERE clause easier?
Again, thank you in advance to anyone who helps!
Greg Received on Mon Apr 30 2007 - 15:07:43 CDT
![]() |
![]() |