Book a Demo

Author Topic: Passing currentElement (ID or Name) to CustomSQL  (Read 3428 times)

jpfiste

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Passing currentElement (ID or Name) to CustomSQL
« on: January 16, 2013, 06:36:39 pm »
Hello,

I'm using the latest Version of EA 10.


I have a custom SQL Query for a RTF Fragment. The Query:

Code: [Select]
SELECT * FROM t_object Element, t_objectproblems ElemIssue
WHERE Element.Object_ID = ElemIssue.Object_ID

But I want the Fragment executed to each Element that I can list all Issues for an element.

I want to add:
Code: [Select]
and Element.Name=
But how do I get the current Element ID or Name for that the Fragment is executed?


Executing per Package is ok, but better grouping in the report I need the element based

Best regards.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Passing currentElement (ID or Name) to CustomS
« Reply #1 on: January 17, 2013, 09:55:32 am »
From the "Custom Query Fragments" help page...

Quote
Custom Queries can reference the ID of the element or package currently being processed by the RTF Template, using the #OBJECTID# or #PACKAGEID# macros

ggandhi

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Passing currentElement (ID or Name) to CustomS
« Reply #2 on: December 24, 2013, 03:28:42 am »
here is an example SQL query:

select distinct t_objectproperties.Value as RuntimeEnv from t_objectproperties  where t_objectproperties.Property in ('01-Runtime Env') and t_objectproperties.Object_ID in (select t_connector.End_Object_ID from t_connector where t_connector.Connector_Type in ('Generalization', 'Realisation') and t_connector.Start_Object_ID=#OBJECTID#)