Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: motivatedgorilla on July 20, 2014, 11:41:53 pm
-
I'm trying to return results similar to the package browser however via SQL however don't quite know how i can display the relationships. My code thus far. Is there a way for me to do this? I'm running the query against an EAP file.
SELECT o.*,p.*
FROM t_object AS o
INNER JOIN t_package AS p on o.Package_ID = p.Package_ID
WHERE o.pdata1 IN (
SELECT o2.pdata1
FROM t_object AS o2
)
ORDER BY p.parent_ID ASC
-
Hi,
The first part of your query will return you all the elements in a package (plus the packages details). The second part of your query (WHERE opdata.... will not work).
If you want the details of each element in the currently selected package and its child packages add
WHERE p.package_id IN (#Branch#)
or for just the current package
WHERE p.package_id IN (#Package#)
If you want your users to be able to select rows in the result set and view the elements details or find it on diagram add...
SELECT o.ea_guid AS CLASSGUID, o.object_type AS CLASSTYPE ....
Regards,
Jon.