Book a Demo

Author Topic: Find elements with no associations  (Read 2500 times)

MrBump

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Find elements with no associations
« on: January 13, 2015, 03:13:45 am »
Hi

I am trying to find a way to to get a list of elements (in this case classes) in the model that are not linked (have no associations) to any other elements.  There are a number of diagrams with classes on that still need associations adding to their "parent" but I don't know an easy way to find them all.

Any ideas?

Thanks
Paul

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Find elements with no associations
« Reply #1 on: January 13, 2015, 06:27:51 am »
You can create a search like this:
Code: [Select]
SELECT ea_guid AS CLASSGUID, name FROM t_object
WHERE t_object.Object_ID NOT IN (SELECT  t_connector.Start_Object_ID FROM t_connector)  
AND t_object.Object_ID NOT IN (SELECT  t_connector.End_Object_ID FROM t_connector)

I don't know if this is "sub-optimal" as I'm no SQL guru, but it will do the job.

q.
« Last Edit: January 13, 2015, 06:28:20 am by qwerty »