# Unable to get Attribute Name using Application Variables

**URL:** <https://forums.toadworld.com/t/unable-to-get-attribute-name-using-application-variables/2796>\
**Category:** Toad Data Modeler\
**Created:** [November 21, 2012, 4:08pm UTC](https://forums.toadworld.com/t/unable-to-get-attribute-name-using-application-variables/2796 "2012-11-21T16:08:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blake.causey\_890](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@blake.causey\_890](https://forums.toadworld.com/u/blake.causey_890)\
**Post date:** [November 21, 2012, 4:08pm UTC](https://forums.toadworld.com/t/unable-to-get-attribute-name-using-application-variables/2796/1 "2012-11-21T16:08:44Z")

</div>

I’m trying to have my Default Constraint Name be the following when I add a new Attribute to an Entity in the Designer:

"DEF\_TableName\_AttributeName for example

I have placed in the Default Settings for the Entitites -\> Attributes -\> Default Constraint name the following “DEF\_\<%OwnerName%\>\_???” but I can’t seem to find out what I should use next.

I’ve tried just about every Application Variable and even some that don’t exist.

Without having this fixed causes the Designer to complain about non-unique names for the Default Constraint Name.

Please help.  
BCausey

---

<div class="post-metadata">

**Author:** ![Vaclav\_Frolik](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vaclav_frolik/32/12_2.png) [@Vaclav\_Frolik](https://forums.toadworld.com/u/Vaclav_Frolik)\
**Post date:** [November 22, 2012, 4:11am UTC](https://forums.toadworld.com/t/unable-to-get-attribute-name-using-application-variables/2796/2 "2012-11-22T04:11:34Z")

</div>

Hi BCausey,

unfortunately the Attribute Name cannot be used as an application variable there (name of the object is not set at the moment and therefore not available).  
There are 3 workarounds:

1. Use application variable DEF\_\<%OwnerName%\>\_\<%UniqueNumber%\>. This will not add the attribute name to the constraint name, but in result you will get unique object names.

2. Use verification and quick fixes to add unique numbers to the Default Contraint Name names. See screenshot.

3. Write a custom macro that will change names for all or selected entities. If you click Macros | Rename | Rename Check Constraint Names, new dialog opens and you can click Help and Show Code at bottom of the dialog to access more information and the custom code. Small modification should help you to achieve what you need, exactly.

Regards,

Vaclav  
 ![ren1.png](https://global.discourse-cdn.com/quest/original/2X/6/6271b065d95f337595c76d4734855223dbbc3e37.png)

---

<div class="post-metadata">

**Author:** ![Vaclav\_Frolik](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vaclav_frolik/32/12_2.png) [@Vaclav\_Frolik](https://forums.toadworld.com/u/Vaclav_Frolik)\
**Post date:** [November 22, 2012, 4:11am UTC](https://forums.toadworld.com/t/unable-to-get-attribute-name-using-application-variables/2796/3 "2012-11-22T04:11:34Z")

</div>

Hi BCausey,

unfortunately the Attribute Name cannot be used as an application variable there (name of the object is not set at the moment and therefore not available).  
There are 3 workarounds:

1. Use application variable DEF\_\<%OwnerName%\>\_\<%UniqueNumber%\>. This will not add the attribute name to the constraint name, but in result you will get unique object names.

2. Use verification and quick fixes to add unique numbers to the Default Contraint Name names. See screenshot.

3. Write a custom macro that will change names for all or selected entities. If you click Macros | Rename | Rename Check Constraint Names, new dialog opens and you can click Help and Show Code at bottom of the dialog to access more information and the custom code. Small modification should help you to achieve what you need, exactly.

Regards,

Vaclav  
 ![ren2.png](https://global.discourse-cdn.com/quest/original/2X/b/b95f84f8fd6afa79af4ea1b6599731e3abce4aa5.png)
