Toad Data Point 3.2 Automation Copy File

I noticed that when I save the automation script in 3.2 the copy file name I specified gets erased. I’m using a wildcard in the source file name. Specifying the same folder name as the source for the copy to folder (maybe that’s not necessary?). Have a copy name specified that’s different than the source. I have both the overwrite file & delete source file checked.

Thanks!

Jason L. Horn

Database Analyst

Concordia University

Yes, this is by design. The target file name is created based on the source file name if you use a wildcard.

Igor.

I was able to rework my solution but I could see the need to want to be able to rename something that is date stamped. Thanks! -Jason

From: Igor Manokhin [mailto:bounce-IgorM@toadworld.com]

Sent: Thursday, June 27, 2013 3:41 PM

To: toaddatapoint@toadworld.com

Subject: RE: [Toad Data Point - Discussion Forum] Toad Data Point 3.2 Automation Copy File

RE: Toad Data Point 3.2 Automation Copy File

Reply by Igor Manokhin

Yes, this is by design. The target file name is created based on the source file name if you use a wildcard.

Igor.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Point - General
notifications altogether.

Toad Data Point - Discussion Forum

Flag
this post as spam/abuse.

I use the automation activity run program and call a batch file (.bat - the old DOS method). In the batch file I can pass in the parameters from the arugment line of the run program activity and build any kind of copy or move command that I like. The file does not have to exist prior to the compile time or be subject to any other issues with the Toad copy file activity.

Hello,

I am running into the same issue as Jason. I however, do not have much expertise running .bat files.

Offhand, is the design you mention revised for any Toad Data Point (TDP) versions after 3.2? If not, any suggestions on how I may get a relabeled Copy File Name to work within TDP when using a wildcard?

Cheers,

Mike

I am using 4.3 and Run Program is still there, I highly doubt they would remove it. Batch files (.bat) are executable files that run a command or series of commands. If you are on a corporate network you may or may not be allowed to execute or even create a .bat file. The inside of the .bat files look something like this:

Rem copy file to import file name using variable parameter %1 to pass the file suffix
Copy R:\Admit_data.xlsx P:\Projects\Medecision\Data\Import\ACM\Admit_data.xlsx
Move R:\Admit_data.xlsx P:\Projects\Medecision\Data\Import\ACM\Archive\Admit_data%1.xlsx
Rem File copied. Remove Rem from last line for production / put Rem before Exit command for testing to keep window open.
Exit

Rem is short for Remark, any line starting with that does not get executed. This batch file copies a file to a processing folder and then archives the file (via the move command) and adds today's date to the file name passed in by the first parameter (%1). To call the batch file it would be the path/name of the batch file in the program box and then the parameters (1st parameter space 2nd parameter space nth parameter) in the arguments box i.e. Copy2Current.bat and 20211215. This will add 20211215 to the end of the file name in the above batch file. If you need a space inside of the parameter you must enclose the whole parameter value inside of double quotes (Copy2Current.bat "2021 12 15").
Same holds true for the file name and path, if there is a space in it put the whole path/name inside of double quotes ("C:\Test batches\Copy2Current.bat" "2021 12 15"). The Exit command ends the batch and returns control back to Toad. Toad does have a fail safe where it can cancel after x number of minutes (default of 60 but you can change it). It also has a return code variable that you can test (normal value is 0 returned for a successful run anything else would be an error number). You can tell Toad not to stop on error (uncheck the box on the Activity Info tab) and set up a next step to handle either a normal exit (zero code) or trap and report out the error message (with a Toad If..Condition). Good luck and have fun. Almost forgot, Toad variable would be put on the argument line as #variableName# or "#variableName#".