Here's an example of spooling to a file (name of file has date string in it), then writting out a comma delimited file...
Good Luck,
Gregg
set space 0
set pagesize 0
set feedback off
set verify off
set termout off
set heading off
set serveroutput off
set echo off
set show off
set trim off
set concat on
set linesize 60
column DAY_NAME new_value file_day noprint
select trunc(SYSDATE) DAY_NAME FROM DUAL;
host del c:\1\ray_file*.txt
spool c:\1\Ray_File_&&whichday..txt
select
to_char(REPORTING_DATE,'YYYYMMDD')||','||LOCATION_IDENTIFIER||','||PART_ID||','||UNIT_OF_MEASURE||', '||QTY_ON_HAND||','
from parts
where reporting_date = upper('&WHICHDAY') and qty_on_hand > 0
order by location_identifier, catalog_id;
Bookmarks