Book a Demo

Author Topic: SQL script for a Model View table  (Read 5553 times)

steen.jensen

  • EA User
  • **
  • Posts: 181
  • Karma: +8/-1
    • View Profile
SQL script for a Model View table
« on: October 31, 2020, 09:22:02 am »
Any one  that can give an example how a ModelView SQL-script that selects elements from a specific parent package (GUID) and shows several colums for specific TaggedValues

Please, me and my collegues have not succeded with this task as we are not fluent in SQL

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: SQL script for a Model View table
« Reply #1 on: October 31, 2020, 09:32:42 am »
Probably you should post your attempt and someone (called Geert) can spot the issue at once.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: SQL script for a Model View table
« Reply #2 on: October 31, 2020, 05:39:32 pm »
This is an example:
It get the details of the elements in a package, including the value and notes notes of memo tag "aa" and the value of regular tag "isPrimary"

Code: [Select]
select o.Object_Type AS CLASSTYPE, o.ea_guid AS CLASSGUID,  o.ea_guid as ownerField, o.TPos as Pos,
o.Name, o.Alias, o.Stereotype, o.Note AS Notes_formatted, 'notused' as Datatype,
o.Multiplicity, o.Cardinality,
o.Scope as Visibility, o.Version, o.Status, o.Abstract, o.GenType as Language,  o.GenFile as FileName, o.PDATA5 as Keywords,
tv1.Value as Tag_aa, tv1.NOTES as TagMemo_aa, tv2.Value as Tag_isPrimary
from (((t_object o
left join t_objectproperties tv1 on (tv1.Object_ID = o.Object_ID and tv1.Property = 'aa'))
left join t_objectproperties tv2 on (tv2.Object_ID = o.Object_ID and tv2.Property = 'isPrimary'))
inner join t_package p on p.Package_ID = o.Package_ID)
where p.ea_guid = '{D3D4FB94-BDE5-4342-B9F7-A726D5136DF8}'


Geert

steen.jensen

  • EA User
  • **
  • Posts: 181
  • Karma: +8/-1
    • View Profile
Re: SQL script for a Model View table
« Reply #3 on: November 01, 2020, 09:19:01 am »
Åhh Super Geert  ;D Im trying that out on monday directly.