Toad World® Forums

Unable to get Attribute Name using Application Variables


#1

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


#2

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


#3

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