Author Topic: Help - how to import tables, columns and PKs from Excel  (Read 2048 times)

Richard Freggi

  • EA User
  • **
  • Posts: 493
  • Karma: +18/-7
    • View Profile
Help - how to import tables, columns and PKs from Excel
« on: April 11, 2023, 09:13:52 pm »
(cross post - I emailed Sparx support about this but I'm on deadline so also asking here)

I use both Sparx Office Integration MDG and the Bellekens excel importer to import thousands of database views and tables into EA to make ERD diagrams etc.

I can import everything I need except primary keys. I import the columns and if they are a PK, the import includes a Method of 'PK' stereotype owned by the <<table>> classifier: this would result in the column having PK properties in EA, *except* I cannot find a way to assign a column to the method during the import (I can import method parameters but the PK assignment is not a parameter).

After the import, if I manually assign the right column to the method using the table 'features' menu, everything works fine.  Does anyone know how to assign during the import (or after via a SQL UPDATE in the EA model database...).  Thanks!

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1374
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Help - how to import tables, columns and PKs from Excel
« Reply #1 on: April 12, 2023, 12:22:23 am »
I'm not sure you can do this without custom scripts.

I worked on a project where we managed to update a column as PK in EA db via t_attribute.IsOrdered from Excel, but I had to define a script to update the PK constraint (operation) parameters to match the attributes name + data type + order.
It gets quite complicated if you have existing FK linking to your PK as they will also need to be updated. Any inconsistency prevents the data modelling features to work properly e.g. updating an FK association.
I found that a number of hidden things are done by EA when you create/update an FK association and it's quite complicated to replicate this.
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com