Toad World® Forums

About Entity Properties -> Attributes tab


#1

Hi

I am wondering if it is possible to allow user to set the data-type to auto-increment on the Data-type field?

I would be grateful if you could provide extra feature to allow user to set the primary it by clicking on the key field,

in some situation E.g. some table would have several primary key, if the above feature will be available, i would be grateful if the user is allow to highlight multi-row and set the primary key from Attributes tab as well.

I understood that we are able to setup primary key on “KEY” tab and change the key name as well, I think the feature that I suggest would be good to have as well, as the default key name could be PK_fieldName or PK_tableName …etc

Please let me know if you want me to explain more. = )

Many thanks

Chi


#2

Hello Chi,

I am wondering if it is possible to allow user to set the data-type to auto-increment on the Data-type field?

Autoincrement can be set in the Attribute Properties dialog | Identity tab (for SQL Server db).

I would be grateful if you could provide extra feature to allow user to set the primary it by clicking on the key field,…and set the primary key from Attributes tab as well.

Yes, we’ve already thought about this. To the existing method, we will add also another way how to assign attribute a PK easier and quicker.
Anyway, your suggestion will be also considered. CR # 33 525.

Regards,

Vladka


#3

<<Autoincrement can be set in the Attribute Properties dialog | Identity tab (for SQL Server db).>>

Yeah, I understand that we can set autoincrement on Attribute properties, I would be grateful to have an extra data type for auto_increment on “Entity Properties” -> Attribute tab. Then we do not need to go to Attribute Properties at all just for Auto increment.

Many thanks

Chi


#4

Hi,

I would be grateful to have an extra data type for auto_increment on “Entity Properties” -> Attribute tab. Then we do not need to go to Attribute Properties at all just for Auto increment.

Welll, autoincrement is not a data type and therefore we think it shouldn’t be among data types.
Nevertheless, we’ve have a tip for you so as not to go to Attribute Properties just for auto increment:

  1. Create a domain (Model | Domains | Add).
  2. Define properties of the domain, including auto increment. - See the Identity tab of the Domain Properties dialog.
  3. Confirm.

Now you can select the domain from the data type combo-box directly on the Attributes tab of an entity.

This might help you.

Regards,

Vladka & TDM Team


#5

The issue I am having with this workaround is that now Identity properties are set with the domain. Now, when I create a relationship with another entity, the identity is copied over. I have to individually override the identity for that attribute in the child entity.


#6

Hello Michael,

Yes, this is how it works in TDM3 . - If you use the domain, create a relationship then, the identity is copied over automatically.

I have to individually override the identity for that attribute in the child entity.

We have a solution for you. :slight_smile:
My co-worker Mario has written a script for you. - Please see the attachment.
The script will go through all FK attributes and will automatically select the checkbox Override Identity. (So, you will not have to do it for each attribute individually. :wink: )

Please run the script in the Scripting Window (Tools | Scripting Window, see the Execute button in the Scripting Window toolbar.)

After you execute the script, take a look at the Log window where all entities and attributes where the checkbox was selected will be written out.

If you have any questions, please write use back.

Regards,

Vladka + Mario
Override_Identity_Script.txt (739 Bytes)


#7

Hi Michael again,

Just a note to the script. Please see:

var Model = app.Models.GetObject(3);
… parameter in GetObject determines with which model the script should work. 0 = first model listed in the Application View, 1 = second model listed in the Application View etc.

The script is also available in the Scripts section in Library:
http://modeling.inside.quest.com/entry.jspa?externalID=1311&categoryID=35

Regards,

Vladka


#8

BTW, thank you.