Jul 3, 2013 4:23:00 PM by Debbie Peabody
Most automation scripts produce some kind of output, such as an Excel report, and these need to be distributed to end users or storage locations. When there are many such reports you might want to zip them up. To do this we will use the Zip activity.
In this example I am producing two excel files. To zip them up, add the zip activity, located under the File activities in the Toolbox. Simply browse to a destination location and provide a name. Now add the files by pressing the add button. In the attachment editor you will see all reports that will be generated by the automation script. They will show up in this list even if they do not exist yet. You can also browse to add other files.
When you run your script you can press the hyperlink to view the zip file.
Sometimes your output files will have unique names based on a variable or timestamp, so the exact name is not known at design time. In this case the attachment editor will include the variable name.
You can also zip up the contents of a directory without naming the files. Use the ‘Zip all files in this directory’ for this. You can make the zip file name unique by adding a suffix. If you need security you can add a password and increase the encryption to ASE-128 or ASE-256.
The zip activity fits nicely for deployment of files and is easy to use.
Written by Debbie Peabody
Debbie Peabody is a Software Development Team Lead. She joined Quest in 1997 coding for Quest’s SQL Tuning product SQLab. She brings many years of experience of development on database tool products and co-designed Toad Data Point.