Book a Demo

Author Topic: View Query Builder query as SQL  (Read 5703 times)

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
View Query Builder query as SQL
« on: September 05, 2018, 09:30:06 am »
Is it possible view a query builder query as SQL?


I'm trying to develop a query for a document along the lines of


Keywords IS NULL OR Keywords LIKE "<value> OR Keywords LIKE "<anothervalue>"


thanks


Simon
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: View Query Builder query as SQL
« Reply #1 on: September 05, 2018, 10:55:44 am »
I think I am getting close thanks to this helpful post


Code: [Select]
SELECT
t_object.ea_guid AS CLASSGUID,
t_object.Object_Type AS CLASSTYPE,
t_Package.Name as Package_Name,
t_object.Name,
t_object.PData5 as Keyword,
t_object.Object_ID
FROM t_object, t_package
where t_object.package_id = t_package.package_id
and ((t_object.PData5 IS NULL) OR (t_object.PData5 LIKE '#WC#cloud#WC#'))
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: View Query Builder query as SQL
« Reply #2 on: September 05, 2018, 12:44:15 pm »
And now something that appears to work - and is being tested:
Code: [Select]
SELECT
t_package.Package_ID AS ExcludePackage,
t_package.Name as Package_Name,
t_object.Name,
t_object.PData5 as Keyword,
t_object.Object_ID
FROM t_object, t_package
WHERE t_package.Package_ID = #PACKAGEID#
AND t_object.Object_ID = #OBJECTID#
AND NOT ((t_object.PData5 IS NULL) OR (t_object.PData5 LIKE '#WC#cloud#WC#'))
with reference to http://www.sparxsystems.com/enterprise_architect_user_guide/13.0/model_publishing/exclude_package_query_and_scri.html

Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.