Chapter 15 Writing SQL Statements in PowerDesigner
Avoids typing a SQL/XML query in the definition of a trigger, a procedure or a function. Use one of the following tools:
After generation, the SQLXML macro is replaced by the SQL/XML query of the global element.
.SQLXML(code of an XML model::code of a global element)
Note: the code of an XML model is optional.
In a trigger for the table EMPLOYEE, the following macro:
.SQLXML(CorporateMembership::DEPARTMENT)
generates the following trigger script:
select XMLELEMENT( NAME "Department", XMLATTRIBUTES (DEPNUM,DEPNAME),
(select XMLAGG ( XMLELEMENT( NAME "Employee", XMLATTRIBUTES (DEPNUM,EMPID,FIRSTNAME,LASTNAME)) )
from EMPLOYEE
where DEPNUM = DEPNUM))
from DEPARTMENT
| Copyright (C) 2005. Sybase Inc. All rights reserved. |
| |