Book a Demo

Author Topic: Search for all linked Documents in the Project  (Read 9274 times)

arphex

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-1
    • View Profile
Search for all linked Documents in the Project
« on: September 11, 2012, 07:36:08 pm »
Like the Search-All-Baselines-Script from the sparx/lieber lieber blog i look for a search to find all linked documents.

thx

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Search for all linked Documents in the Project
« Reply #1 on: September 11, 2012, 08:03:36 pm »
This is what I use:

Code: [Select]
select c.ea_guid as CLASSGUID,c.object_type as CLASSTYPE,c.name as Name, c.stereotype as Stereotype
,package.name as PackageName ,package_p1.name as PackageLevel1,package_p2.name as PackageLevel2
,package_p3.name as PackageLevel3
from (((((t_object c
inner join t_document as d on d.ElementID like c.ea_guid)
inner join t_package as package on c.package_id = package.package_id)
left join t_package as package_p1 on package_p1.package_id = package.parent_id)
left join t_package as package_p2 on package_p2.package_id = package_p1.parent_id)
left join t_package as package_p3 on package_p3.package_id = package_p2.parent_id)
where d.ElementType = 'ModelDocument'
and c.name like '#WC#<Search Term>#WC#'

Geert

arphex

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-1
    • View Profile
Re: Search for all linked Documents in the Project
« Reply #2 on: September 11, 2012, 09:06:18 pm »
Hi Gert,

thank you.
Problem is, there is no output.
But i have a few linked documents.
i pasted it exactly like you posted it.

thankyou

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Search for all linked Documents in the Project
« Reply #3 on: September 11, 2012, 09:11:19 pm »
Ah, in that case you probably did it the wrong way.

You have to create a new search of type "SQL" and then paste the sql code in the Search Builder tab.
For some bizarre reason the SQL tab is not meant to paste SQL into :-X

Geert

arphex

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-1
    • View Profile
Re: Search for all linked Documents in the Project
« Reply #4 on: September 11, 2012, 09:19:52 pm »
Hi Geert,

i did this already
@SQL-Tab it is not really working :-)

whats wrong? the columns appears already.

Philipp

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Search for all linked Documents in the Project
« Reply #5 on: September 11, 2012, 09:43:31 pm »
I'm not sure, could be a difference in database types.
I'm using this search query on an SQL Server 2008 database.

EA version is 9.3.935

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Search for all linked Documents in the Project
« Reply #6 on: September 11, 2012, 11:06:50 pm »
Look into %APPDATA%/Sparx Systems/EA/DBError.txt. It might give a hint.

q.

arphex

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-1
    • View Profile
Re: Search for all linked Documents in the Project
« Reply #7 on: September 11, 2012, 11:13:27 pm »
its empty :-)
and i use also 9.3.935 and SQL Server 2008 ...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Search for all linked Documents in the Project
« Reply #8 on: September 12, 2012, 03:44:17 pm »
Bizarre  :o

Just to verify things, what happens if you use this query?
Code: [Select]
select c.ea_guid as CLASSGUID,c.object_type as CLASSTYPE,c.name as Name, c.stereotype as Stereotype from t_object c
If yo still don't have any results there's something wrong with the way you are editing the SQL Search.

Geert

arphex

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-1
    • View Profile
Re: Search for all linked Documents in the Project
« Reply #9 on: September 14, 2012, 04:51:20 pm »
Hi, thanks for reply.
this is my output, i dont really know what all but seems to be all items.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Search for all linked Documents in the Project
« Reply #10 on: September 14, 2012, 04:57:12 pm »
I can't see the image you posted (our lovely internet filter won't allow it) but if you see something then that means that your query works.

It also means I don't have a clue why the other query won't return any results.
Maybe time to call in the cavalry( i.e. send an email to Sparx support)

Geert

arphex

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-1
    • View Profile
Re: Search for all linked Documents in the Project
« Reply #11 on: September 14, 2012, 05:29:32 pm »
Hi Thank you,
i have a result :-)

hmmm... i will look what i can do. thank you

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Search for all linked Documents in the Project
« Reply #12 on: September 17, 2012, 12:06:17 pm »
Re: original request - Below is just a simple query for Linked Documents:

SELECT ea_guid as CLASSGUID, Object_Type as CLASSTYPE, Name
FROM t_object, t_document
where t_object.ea_guid =  t_document.ElementId and t_document.Doctype ='ModelDocument'