Author Topic: Help on custom SQL fragment  (Read 3334 times)

Lars

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Help on custom SQL fragment
« 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?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Help on custom SQL fragment
« Reply #1 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
« Last Edit: November 12, 2015, 07:11:31 am by Geert.Bellekens »