Author Topic: How to add PK to columns of tables via DML operations?  (Read 1920 times)

Richard Freggi

  • EA User
  • **
  • Posts: 486
  • Karma: +18/-7
    • View Profile
How to add PK to columns of tables via DML operations?
« on: November 20, 2024, 02:48:53 pm »
I reverse engineer several database types by querying their metadata objects, exporting to Excel and using Office MDG to import into EA (16.1).  Works well except that primary key columns are imported as <<pk>> stereotype but in EA it is treated as any stereotype and the PK -  NN boxes in the Properties window remain unchecked: EA does not recognize it as a primary key.  So I have to manually check the PK box for every column with a <<pk>> stereotype.
I would like to do that via a DML script like (pseudocode:) UPDATE t_attribute SET somethingsomething = 'pk' WHERE stereotype = 'pk' .  But In Inside EA book I could not find what table column needs to be updated and how.  If anybody knows please help!  Thanks!
ps sorry no time to learn VB or scripting languages... my only option is to run DML on the project database

Takeshi K

  • EA User
  • **
  • Posts: 560
  • Karma: +35/-1
    • View Profile
Re: How to add PK to columns of tables via DML operations?
« Reply #1 on: November 20, 2024, 03:09:52 pm »
That is the 'IsOrdered' column of t_attribute.

You can find the related information in the following help page.
https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/attribute.html

HTH,
--
t-kouno

Richard Freggi

  • EA User
  • **
  • Posts: 486
  • Karma: +18/-7
    • View Profile
Re: How to add PK to columns of tables via DML operations?
« Reply #2 on: November 20, 2024, 03:20:48 pm »
YESSSSSS!  Thank you very much