Book a Demo

Author Topic: SQL for ConveyedItems  (Read 5313 times)

SMaric

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
SQL for ConveyedItems
« on: January 29, 2013, 11:19:02 pm »
Hi, I need some help

I have Elements (t_object) of type InformationItem which are associated with Connectors (t_connector) of type InformationFlow

In the API these will be available from the Connector class via the conveyedItems collection

I am trying to build direct SQL queries - can't seem to find the linkages from t_connector to t_object

Any help gratefully received
Regards
Stefan Maric


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: SQL for ConveyedItems
« Reply #1 on: January 29, 2013, 11:46:24 pm »
t_connector.Start_Object_ID is the t.object.Object_ID of the start element.

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: SQL for ConveyedItems
« Reply #2 on: January 30, 2013, 12:06:12 am »
Hi,

see enclosed SQL. It's a bit tricky. I send it in two parts.

Kind regards

Helmut
SELECT DISTINCT o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE,
 o.name As Item, o.Object_Type As ItemType, o.stereotype As ItemStereotype, 'Connector' As ConnectorType, c.Name, c.Stereotype
 
FROM t_object o,
          t_xref xCon, t_xref xFlow,
          t_connector c,
    t_connector flow
where
  c.connector_ID = <Search Term>
and   c.ea_guid = xCon.Client
and   xCon.Behavior = 'abstraction'
and flow.ea_guid in
(
#DB=SQLSVR#             substring(xCon.description,0,39),
                                      substring(xCon.description,39,39),
                                      substring(xCon.description,78,39),
                                      substring(xCon.description,117,39),
                                      substring(xCon.description,156,39),
                                      substring(xCon.description,195,39),
                                      substring(xCon.description,234,39),
                                      substring(xCon.description,273,39),
                                      substring(xCon.description,312,39),  
                                      substring(xCon.description,351,39)
#DB=SQLSVR#  
#DB=ORACLE#
                                                        SubStr(Cast(xCon.description As Varchar(39)),0,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),40,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),79,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),118,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),157,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),196,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),235,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),274,38),
                                      SubStr(Cast(xCon.description As Varchar(39)),313,38),  
                                      SubStr(Cast(xCon.description As Varchar(39)),352,38)

#DB=ORACLE#
#DB=Other#                left(xCon.description,38),
                                      mid(xCon.description,40,38),
                                      mid(xCon.description,79,38),
                                      mid(xCon.description,118,38),
                                      mid(xCon.description,157,38),
                                      mid(xCon.description,196,38),
                                      mid(xCon.description,235,38),
                                      mid(xCon.description,274,38),
                                      mid(xCon.description,313,38),  
                                      mid(xCon.description,352,38)
#DB=Other#  
  )
AND         flow.ea_guid = xFlow.client
AND         o.ea_guid in  
(
#DB=SQLSVR#             substring(xFlow.description,0,39),
                                      substring(xFlow.description,39,39),
                                      substring(xFlow.description,78,39),
                                      substring(xFlow.description,117,39),
                                      substring(xFlow.description,156,39),
                                      substring(xFlow.description,195,39),
                                      substring(xFlow.description,234,39),
                                      substring(xFlow.description,273,39),
                                      substring(xFlow.description,312,39),  
                                      substring(xFlow.description,351,39)
#DB=SQLSVR#    
#DB=ORACLE#
                                                        SubStr(Cast(xFlow.description As Varchar(39)),0,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),40,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),79,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),118,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),157,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),196,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),235,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),274,38),
                                      SubStr(Cast(xFlow.description As Varchar(39)),313,38),  
                                      SubStr(Cast(xFlow.description As Varchar(39)),352,38)

#DB=ORACLE#
#DB=Other#                left(xFlow.description,38),
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: SQL for ConveyedItems, Part 2 of SQL
« Reply #3 on: January 30, 2013, 12:09:28 am »
Hi,

enclosed part 2.

Kind regards,

Helmut
#DB=ORACLE#
#DB=Other#                left(x.description,38),
                                      mid(x.description,40,38),
                                      mid(x.description,79,38),
                                      mid(x.description,118,38),
                                      mid(x.description,157,38),
                                      mid(x.description,196,38),
                                      mid(x.description,235,38),
                                      mid(x.description,274,38),
                                      mid(x.description,313,38),  
                                      mid(x.description,352,38)
#DB=Other#  
  )
  
  
order by 3,4,5
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)