Book a Demo

Author Topic: ModelView and recursive query (child packages)  (Read 4656 times)

thomasbru

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
ModelView and recursive query (child packages)
« on: November 21, 2014, 01:14:44 am »
Hello,

I need to display the recently created/updated elements of a specific package including the child packages in a Model View.
Can please some get me start on how to provide a recursive query (when I use the WITH-Statement I receive the message that a select statement is needed).

Thanks a lot and best regards

thomasbru

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: ModelView and recursive query (child packages)
« Reply #1 on: November 21, 2014, 01:36:06 am »
Found a solution if you are working on an oracle environment:

SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name AS ObjectName, t_package.Name AS PackageName, t_object.Author, t_object.ModifiedDate, t_object.CreatedDate
FROM t_package INNER JOIN t_object ON t_package.Package_ID=t_object.Package_ID
where t_object.Package_ID in (select  package_ID from t_package p start with p.EA_GUID = '{123456789}' connect by parent_ID = prior Package_ID)
Order by  t_object.ModifiedDate desc, t_object.CreatedDate desc
« Last Edit: November 21, 2014, 02:14:22 am by thomasbru »

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: ModelView and recursive query (child packages)
« Reply #2 on: November 21, 2014, 04:35:54 am »
Within Sparx your can also use this:

package_id IN (#Branch#)

construct in your SQL. This will bring back all packages under the selected package in the project browser...