# User Defined Variables in Options

**URL:** <https://forums.toadworld.com/t/user-defined-variables-in-options/38463>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [October 6, 2016, 9:40am UTC](https://forums.toadworld.com/t/user-defined-variables-in-options/38463 "2016-10-06T09:40:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angie.freeman](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@angie.freeman](https://forums.toadworld.com/u/angie.freeman)\
**Post date:** [October 6, 2016, 9:40am UTC](https://forums.toadworld.com/t/user-defined-variables-in-options/38463/1 "2016-10-06T09:40:18Z")

</div>

I’m trying to export a file with a variable name by using the user defined variables in options. When I try to define my variable as select to\_char(sysdate,‘mmm yyyy’) from dual it puts that statement in the file name rather than the result of the statement. how do I format this in the variable so that it recognizes it as a formula rather than text?

---

<div class="post-metadata">

**Author:** ![damir.vadas\_250](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/damir.vadas_250/32/37_2.png) [@damir.vadas\_250](https://forums.toadworld.com/u/damir.vadas_250)\
**Post date:** [October 11, 2016, 7:39am UTC](https://forums.toadworld.com/t/user-defined-variables-in-options/38463/2 "2016-10-11T07:39:27Z")

</div>

I put the solution on mine blog page:

[http://damir-vadas.blogspot.co.at/2016/10/toads-automation-designer-and-sqlplus.html](http://damir-vadas.blogspot.co.at/2016/10/toads-automation-designer-and-sqlplus.html)

@Toad tech guys…  
Toad 12.10.0.30 x64 version tested  
Could you checked why user variable (if is previously defined in Toad) prevent initialization from outside (but only from Toad app)?  
I thin this is not Ok behavior and Toad should not control it.  
Brg

Damir

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 11, 2016, 1:33pm UTC](https://forums.toadworld.com/t/user-defined-variables-in-options/38463/3 "2016-10-11T13:33:23Z")

</div>

Right-click in the filename edit box of the export dataset dialog. Choose “Variables”, and then DATEFILE, and click OK.

That will put %DATEFILE% in the edit box. Then add a path, so it looks like C:%DATEFILE%.txt or whatever you want. It’s not as customizable as TO\_CHAR() but hopefully that will be close enough.
