There appears to be an issue when using an automation variable - specifically a text variable - with an Export Template in at least one scenario.
I created an automation and created a variable used to hold an output file name (to make it easily changeable later, if needed), and then I created an Export Template because I needed data output in a specific format (tab delimited, all data quoted).
I used the automation variable (#FileName# set to VENDOR_FILE_#Date#A.txt), in the output options as seen below:
But I would like to avoid hard-coding the file name, since in order to update it you have to edit the export template, instead of just opening the automation and updating a variable.
As I see it, there are two issues here
The export template adding the extraneous single quotes/tick marks around the file name, if the filename itself is a variable - though having a variable in the filename doesn't appear to be an issue, oddly enough.
The export template forcibly sets the file extension to .txt no matter what. The export template should be agnostic as to the output file extension, leaving it up to the automation developer to determine.
Thoughts?
Frankly I didn’t realize we coded support for automation vars in export templates. Pretty cool (except for the quotes as you point out). I entered QAT-6946 to fix this.
I haven’t tried to see if variables will be passed correctly from Automation to a script inside of an Export Template yet - that would be incredibly useful if it exists or could be implemented at some point.
I have, it works great. Just put :variableName in your export query. Your Toad automation variable has to have the same name without the colon in front. I have not tried this on the new versions but it worked on the past versions.
I tried it in 3.7 and the colon variable that prompts you in a query will still pull in the automation variable with the same name. Trust me they will fix the single quote and extra .txt issue. One of the best things about Toad is the support and development people and you have Debbie putting in this QAT (she is their automation goddess), this product just keeps getting better. I should work for their sales dept.
We are actually coding the fix right now. Im not sure if it will make into the next Beta but it might. I have a new Automation developer. Let me get him to answer this post to give you an update.
P.S. I’m not so sure I’m the automation goddess but I do like making the product better[:O]
I have been given a great opportunity and became the new Automation developer and I will do my best to provide you with the support you deserve. I hope that i will satisfy your needs and expectations. Looking forward to collaboration! (=
Regarding this issue:
The necessary changes to fix the problem have been implemented and it seems to work in our test environment. This means - you can expect the fix in the new upcoming version of Toad.