Toad World® Forums

[TDP 3.8] Automation with Export Template - Variable Issue

Greetings,

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:

However, upon executing the template, the file created is named 'VENDOR_FILE_12312015A.txt'.txt :

TDP 3.8 Export Template 2.png

I was able to work around this by changing the Export Template output options to:

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

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

To be fair, I think it’s fairly recent :slight_smile:

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.

Fantastic, then if this issue gets fixed that will make the Export Template activity far more usable for some of our scenarios.

Especially if the forced .txt extension gets fixed as well.

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]

Hello everyone,

Please allow me to introduce myself to you.

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.

  • Martin

Martin,

You have joined a great team and you are off to a good start! Let us know when the beta is released.

N.B.,

I told you they would fix it, and they did it fast! This product has the best people ever.

  • Greg

This fix (QAT-6946) is in today’s Beta - TDP 4.0.0.230. Check it out.[Y]