Author Topic: SQL Help  (Read 2793 times)

crd

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
    • View Profile
SQL Help
« on: September 22, 2012, 07:19:31 am »
Was wondering if someone would help me figure out how to write 2 queries:
1.  Identifying Model that Project Browser selected package is in?
2.  Identifying all the elements of a particular object type and stereotype within that selected model.

Am I just missing something that is easy?  Would appreciate your thoughts.

Thanks isn advance,
Carol

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: SQL Help
« Reply #1 on: September 22, 2012, 06:09:41 pm »
1. what?
2.
Code: [Select]
SELECT
  o.ea_guid As CLASSGUID, o.Object_type As CLASSTYPE, o.name, o.Object_type As Type, o.Stereotype
FROM
  t_object o, t_package pkg
WHERE
  pkg.Package_id in (#Branch#)
  AND o.Package_ID = pkg.package_id
  AND o.Stereotype = 'thestereotype'
  AND o.Object_type = 'thetype'

I haven't verified 2. but taken a sample from my book and cutting parts away.

q.

crd

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
    • View Profile
Re: SQL Help
« Reply #2 on: September 23, 2012, 12:33:19 am »
1.  Ha!  Let me try again.  I want to identify the root node for the selected package.
2.  Thank you.  I need to roll up my sleeves and get a handle on the #xxx# that are available in EA.  Totally stupid question on a Saturday morning - with not enough coffee in me.  If I am writing against the API in a MS Word macro are the #xxx# available to me?

Thanks!
Carol

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: SQL Help
« Reply #3 on: September 23, 2012, 02:28:17 am »
Nope, you have to recurse throught the packages youself.

Take a look at this thread: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1347356168/1#1