Book a Demo

Author Topic: SQL Search w model documents - only first element?  (Read 5601 times)

Hurra

  • EA User
  • **
  • Posts: 184
  • Karma: +0/-0
    • View Profile
    • Find me at LinkedIn!
SQL Search w model documents - only first element?
« on: March 27, 2018, 07:52:11 pm »
Hello!

I use a SQL search to find my elements that I want in a table in my report.

I made it easy for me and put the desired elements in a diagram and my search has diagram name as input and lists all the elements on the diagram which was found:

Code: [Select]
SELECT o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.name AS Name, o.Note AS description
FROM (( t_object o
INNER JOIN t_diagramobjects do ON do.Object_ID = o.Object_ID)
INNER JOIN t_diagram d ON d.Diagram_ID = do.Diagram_ID)
WHERE d.name LIKE '#WC#<Search Term>#WC#'
ORDER BY o.Name ASC

The result is correct according to the SQL search/output window, however in the report, only the first element of that list is generated.

What am I missing?

Thanks!
always learning!

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 Search w model documents - only first element?
« Reply #1 on: March 27, 2018, 08:55:42 pm »
What does the template look like?

Geert

Hurra

  • EA User
  • **
  • Posts: 184
  • Karma: +0/-0
    • View Profile
    • Find me at LinkedIn!
Re: SQL Search w model documents - only first element?
« Reply #2 on: March 27, 2018, 09:18:27 pm »
package>
element>

table with Element.Name and Element.Notes

<element
<package
always learning!

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 Search w model documents - only first element?
« Reply #3 on: March 27, 2018, 09:39:36 pm »
And you are using a model document with the search and this template?

Geert

Hurra

  • EA User
  • **
  • Posts: 184
  • Karma: +0/-0
    • View Profile
    • Find me at LinkedIn!
Re: SQL Search w model documents - only first element?
« Reply #4 on: March 27, 2018, 11:29:41 pm »
And you are using a model document with the search and this template?

Geert

Yes. The search is selected through tagged values, and also search string specified.
always learning!

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 Search w model documents - only first element?
« Reply #5 on: March 28, 2018, 03:55:16 am »
Weird. I'm not sure why it doesn't work.
I've used similar constructions in the past without issues.

Nothing in the template filters that is blocking some content?

Geert

Hurra

  • EA User
  • **
  • Posts: 184
  • Karma: +0/-0
    • View Profile
    • Find me at LinkedIn!
Re: SQL Search w model documents - only first element?
« Reply #6 on: March 28, 2018, 06:59:30 am »
Weird. I'm not sure why it doesn't work.
I've used similar constructions in the past without issues.

Nothing in the template filters that is blocking some content?

Geert

Before I implemented the new diagram and SQL search I tried to get my elements of interest with filters... Ofc I forgot about that.

Thank you!

As an extra I can ask if this approach is considered "good". We have structured a stereotype with the dependency relation, depends on/needed by. If I only want the TOP element, can I create an SQL search to find all these elements but filter out the elements which only acts as source? The TOP element is never target I guess?

Thanks again Geert!
always learning!