Toad World® Forums

automate export to excel with variable


Can toad via command line or automation export to excel but with variable in the export sql or any method, so that for example, the data exported is depedant on the current day and as well, the exported data filename will contain the current date in its filename?

If yes, how? Google does not indicate it support parameters or variable…



For part of this (i.e. date in file name) simply open help, go to index tab,
type “variable” and choose this entry to start with:
“variables, using”


Right-click in the edit box where you choose the file name, and choose
“variables”. I’m not sure what version of Toad you are using
but this is there for the last few versions at least.


I see the variable when I right click the filename part. :slight_smile: great, but how unintuitive though…let me experiment a bit…

Message was edited by: roi8877


[ Attachment(s) from John Dorlon included below]

I just checked 10.6. It’s there. See screen shot.

Right-click in the export dialog where the filename goes. Then you can pick a
variable as part of the file name. When you run the export, the variable will
get changed into date or whatever.

For instance, if you enter this for the filename: c:\data_%DATEFILE%.xls

Then when you run the export, the file name will be: C:\data_2011_2_11.xls