Book a Demo

Author Topic: Relationship Matrix with SQL Search  (Read 9055 times)

Maggie

  • EA User
  • **
  • Posts: 106
  • Karma: +0/-0
    • View Profile
Relationship Matrix with SQL Search
« on: April 25, 2013, 08:11:34 pm »
Hello all
I have a SQL search setup that report elements depending upon a given tagged value. This works and gives the expected results.
Now I want to use this in the Relationship matrix so I set the source/target using the 'Apply Model Search' option and enter my search and search term. However, no results are seen in the relationship matrix

I would be grateful if someone could throw some light on what I might be doing wrong?

Thanks

Maggie

Maggie

  • EA User
  • **
  • Posts: 106
  • Karma: +0/-0
    • View Profile
Re: Relationship Matrix with SQL Search
« Reply #1 on: April 25, 2013, 09:09:28 pm »
ARGHHHHH
Here is my original SQL search that does not work in the RA
Code: [Select]
select o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE ,o.Name,o.Stereotype
from (t_object o
inner join t_objectproperties tag on o.Object_ID = tag.Object_ID)
where o.Object_Type = 'Requirement'
and tag.Property like 'Phase'
and tag.Value like '#WC#<Search Term>#WC#'

Now here is one that DOES work
Code: [Select]
select o.ea_guid [highlight]AS[/highlight] CLASSGUID, o.Object_Type as CLASSTYPE ,o.Name,o.Stereotype
from (t_object o
inner join t_objectproperties tag on o.Object_ID = tag.Object_ID)
where o.Object_Type = 'Requirement'
and tag.Property like 'Phase'
and tag.Value like '#WC#<Search Term>#WC#'

Spot the difference?
as replace with AS :-[ :-[ :-[

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relationship Matrix with SQL Search
« Reply #2 on: April 25, 2013, 11:16:14 pm »
Looks like an EA bug. Especially as you did not need to replace the second AS. Or maybe you have a strange RDBMS?

q.

markuss

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Relationship Matrix with SQL Search
« Reply #3 on: September 29, 2016, 11:09:11 pm »
Hi,

I have a very similar issue (EA 12.0), however, capitalizing the AS does not help.
Code: [Select]
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, t_object.*  FROM

((((((t_object INNER JOIN t_package AS ObjectParent ON  t_object.package_id = ObjectParent.package_id)

LEFT JOIN t_package AS PackageParent1 ON (ObjectParent.Parent_ID = PackageParent1.package_id))
LEFT JOIN t_package AS PackageParent2 ON (PackageParent1.Parent_ID = PackageParent2.package_id))
LEFT JOIN t_package AS PackageParent3 ON (PackageParent2.Parent_ID = PackageParent3.package_id))
LEFT JOIN t_package AS PackageParent4 ON (PackageParent3.Parent_ID = PackageParent4.package_id))
LEFT JOIN t_package AS PackageParent5 ON (PackageParent4.Parent_ID = PackageParent5.package_id))

WHERE

...

The query collects particular types of requirements from different sub-packages that belong to the same project in a multi-project repository.
Same issue as for Maggie:  It returns the expected results in the SQL view. It does not populate the source/target column in the relationship matrix.

Any ideas?

Thank you very much in advance

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Relationship Matrix with SQL Search
« Reply #4 on: September 30, 2016, 06:50:51 pm »
have you tried without the
Code: [Select]
t_object.*?
I'm guessing that is the culprit.

Geert

markuss

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Relationship Matrix with SQL Search
« Reply #5 on: September 30, 2016, 11:13:33 pm »
Thank you very much for answering, Geert!

However, I just figured out that my problem was actually caused by the name I had assigned to the custom query which was "Requirement + Risk Keys for <name of my project>". After I renamed the query to "TestQuery", it works in the relationship matrix as well.

BTW: Now it also works when I include the t_object.* in the SELECT clause.

However, thanks again - you were indirectly helpful in solving my problem, for I tried your hint in a trivial query called "TestQuery" and incrementally included more and more of my acutal query till I found out that it completely works.

Markus