Book a Demo

Author Topic: SQL - Macro #Branch#: Result entire model  (Read 6697 times)

Pegasus

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
SQL - Macro #Branch#: Result entire model
« on: January 14, 2017, 12:44:21 am »
Hello,

I am just testing #Branch# Macro with some case
and is see that result seems to be entire modell wheater if selected package contains further packages  or not? I expecte #Branch contains
Query:
select o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.name, o.ea_guid, o.Object_type AS Type, o.Stereotype, o.Author, o.modifiedDate AS Modified, o.note AS [Notes] FROM t_object o, t_package pkg WHERE pkg.Package_ID IN (#Branch#)

from user guide
http://sparxsystems.com/enterprise_architect_user_guide/13.0/model_navigation/creating_filters.html
Gets the IDs of the child Packages of the currently-selected Package, working recursively down to the lowest level of sub-Package. For example:
t_object.Package_ID IN (#Branch#)

Thanks
Pegasus

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 - Macro #Branch#: Result entire model
« Reply #1 on: January 14, 2017, 01:40:26 am »
I've used #Branch# is lots of search queries, and it has never failed me.

Have you tried running a project integrity check?

Geert

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: SQL - Macro #Branch#: Result entire model
« Reply #2 on: January 16, 2017, 11:54:54 pm »
Hi,

Your query is missing a join, try :

select o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.name, o.ea_guid, o.Object_type AS Type, o.Stereotype, o.Author, o.modifiedDate AS Modified, o.note AS [Notes] FROM t_object o, t_package pkg WHERE pkg.Package_ID IN (#Branch#)
AND o.package_ID = pkg.Package_ID

Regards,

Jon.