# Creating a dynamic named zip file using Automation Designer

**URL:** <https://forums.toadworld.com/t/creating-a-dynamic-named-zip-file-using-automation-designer/28588>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [January 29, 2014, 10:31am UTC](https://forums.toadworld.com/t/creating-a-dynamic-named-zip-file-using-automation-designer/28588 "2014-01-29T10:31:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oohmylord](https://avatars.discourse-cdn.com/v4/letter/o/b782af/32.png) [@oohmylord](https://forums.toadworld.com/u/oohmylord)\
**Post date:** [January 29, 2014, 10:31am UTC](https://forums.toadworld.com/t/creating-a-dynamic-named-zip-file-using-automation-designer/28588/1 "2014-01-29T10:31:32Z")

</div>

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:

1. 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

1. 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!!**

---

<div class="post-metadata">

**Author:** ![Dennis\_Paulus](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/dennis_paulus/32/138_2.png) [@Dennis\_Paulus](https://forums.toadworld.com/u/Dennis_Paulus)\
**Post date:** [January 29, 2014, 10:42am UTC](https://forums.toadworld.com/t/creating-a-dynamic-named-zip-file-using-automation-designer/28588/2 "2014-01-29T10:42:37Z")

</div>

Doesn’t look like the filename field in the archive action allows for variable control, which would be needed to do what you want. Looks like this would  
be a good enhancement. Please add this to the Toad for Oracle Idea Pond…

[http://www.toadworld.com/products/toad-for-oracle/i/utilities/default.aspx](http://www.toadworld.com/products/toad-for-oracle/i/utilities/default.aspx)

**From:** oohmylord [[mailto:bounce-oohmylord@toadworld.com](mailto:bounce-oohmylord@toadworld.com)]

**Sent:** Wednesday, January 29, 2014 1:32 PM

**To:** [toadoracle@toadworld.com](mailto:toadoracle@toadworld.com)

**Subject:** [Toad for Oracle - Discussion Forum] Creating a dynamic named zip file using Automation Designer

**[Creating a dynamic named zip file using Automation Designer](http://www.toadworld.com/products/toad-for-oracle/f/10/t/21207.aspx)**

Thread created by oohmylord

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:

1. 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

1. 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!!**

To reply, please reply-all to this email.

[Stop receiving emails](http://www.toadworld.com/products/toad-for-oracle/f/10/t/21207.aspx?subscribe=false) on this subject.

Or [  
Unsubscribe from Toad for Oracle - General](http://www.toadworld.com/products/toad-for-oracle/f/10.aspx?subscribe=false) notifications altogether.

Toad for Oracle - Discussion Forum

[Flag](http://www.toadworld.com/products/toad-for-oracle/f/10/t/21207.aspx?AbuseContentId=2b3cb612-77ff-467f-8856-8f4154cd9586&AbuseContentTypeId=46448885-d0e6-4133-bbfb-f0cd7b0fd6f7&AbuseFlag=true)  
this post as spam/abuse.

![](http://gyk.r.mailjet.com/o/04j0/6ece2496/pu49o4xe.gif)

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [January 30, 2014, 6:10am UTC](https://forums.toadworld.com/t/creating-a-dynamic-named-zip-file-using-automation-designer/28588/3 "2014-01-30T06:10:29Z")

</div>

It will take longer to discuss than to just add variable support there, and it should probably be there anyway. I’ll be there next beta.

---

<div class="post-metadata">

**Author:** ![Bert\_Scalzo](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/bert_scalzo/32/274_2.png) [@Bert\_Scalzo](https://forums.toadworld.com/u/Bert_Scalzo)\
**Post date:** [January 30, 2014, 6:34am UTC](https://forums.toadworld.com/t/creating-a-dynamic-named-zip-file-using-automation-designer/28588/4 "2014-01-30T06:34:34Z")

</div>

You’ll be there or variable support will be there? 🙂

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [January 30, 2014, 6:39am UTC](https://forums.toadworld.com/t/creating-a-dynamic-named-zip-file-using-automation-designer/28588/5 "2014-01-30T06:39:12Z")

</div>

[iheartjimmy.wordpress.com/…/potato-potahto](http://iheartjimmy.wordpress.com/2010/02/27/potato-potahto/)
