The query editor recognizes both --
and /* */
, but neither seems to actually work. So no.
Best way is to store your queries as searches.
Question
Is there a way to comment SQL queries in Sparx Enterprise Architect e.g. /* SQL Query */. This is so that I can run different queries without having to delete previous queries.
Solution
The query editor recognizes both --
and /* */
, but neither seems to actually work. So no.
Best way is to store your queries as searches.
OTHER TIPS
Enterprise Architect's #DB=# macro works well for comments in SQL Model Search queries.
#DB=COMMENT# <comment text> #DB=COMMENT#
For example, to explain why a query differs for JET4.0 vs. MYSQL versions:
SELECT distinct o1.ea_guid AS CLASSGUID,
o1.name AS Name,
o2.name AS Subtype,
o3.name AS Sub2,
o4.name AS Sub3,
o5.name AS Sub4
#DB=COMMENT# JET does not allow mixing LEFT/INNER JOINS #DB=COMMENT#
#DB=JET#
FROM <complex join, JET version>
#DB=JET#
#DB=MYSQL#
FROM <complex join, MySQL version>
#DB=MYSQL#
WHERE
o1.object_type = 'Class'
AND o1.name LIKE '#WC#<Search Term>#WC#';
Comments with --
and /* */
are working in Enterprise Architect if the comment is not in the first line.