I’m trying to use the Automation Designer tool to create a dynamically named zip file. Basically I want the query run start date (sysdate -7 ) and end date (sysdate) appended to the end of the zip file name (example testfilename_ddmmyyyy_ddmmyyyy.zip). I have been able to successfully create dynamically named files in the past using the file iterator and variables on export data sets, but when I try the same steps to create an archive file it simply shows the variable holder (example testfilename_%zip_dt%.zip) in the file name.
Steps that I’m following:
- create Execute Script to get the dates and save them for later
set serveroutput on size 10000
set feedback off
declare
l_filename4 varchar(50) ;
begin
select to_char(trunc(sysdate-7),‘yyyymmdd’) ||’-’|| to_char(trunc(sysdate-1), ‘yyyymmdd’)
into l_filename4
from dual;
dbms_output.put_line(l_filename4);
end;
Outputting to Output2.txt
- Create a File Iterator with variable and archive
FileIterator1 [C:\output2.txt]
|
|-- Create Variable[postzip = c:\testfilename_%FileIterator1%.zip]
|–Archive[c:%postzip%.zip]
Items to compress = c:\samplefiles*.csv
The output2.txt creates correctly, the zip file compresses all csv files, but the new zip file is called %postzip%.zip
Hopefully, this makes sense.
Version info:
Toad Version 12.1.0.22
Oracle 10g 64bit
THANKS IN ADVANCE!!