Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Lars on November 12, 2015, 02:05:06 am

Title: Help on custom SQL fragment
Post by: Lars on November 12, 2015, 02:05:06 am
I'm using a template to simply document all of the types that have been defined in the model. Now I want to add information about all of the instances (properties) that each type classifies. The relation between the elements is to be considered part to property type.

My approach so far has been to add a template fragment, that for each type, performs a SQL query (using a custom SQL fragment) to list all of the associated properties.

Any thoughts on how to formulate the SQL query, or by the way, is there any another way that does not involve SQL queries?
Title: Re: Help on custom SQL fragment
Post by: Geert Bellekens on November 12, 2015, 07:11:20 am
With "properties" do you mean Attributes, or some kind of classified objects?

In case of attributes you can use something like
Code: [Select]
select a.[Name] AS AttributeName, o.[Name] as OwnerName from (t_attribute a
inner join t_object o on a.[Object_ID] = o.[Object_ID])
where a.[Classifier] = '#OBJECTID#'

Geert