Custom Query Fragments

You can create Template Fragments to return data from SQL Queries, or from Model Scripts. The first step in defining such Fragments is to use the Custom Query settings to enter either your SQL Search or a starting point for your Model Script.

Access     Tools | Document Template Designer: <template> > Content | File | Document Options > Custom Query

Custom Query Options

Option

Action

See also

Custom SQL

Click on this radio button to enter an SQL Query.

You can then add fields within the Custom section of your Template Fragment, to refer to the data returned by the SQL Query.

 

Custom SQL Fragments

Custom Script

Click on this radio button to display a field in which you specify a Model Script; click on the drop-down arrow and select the name of the Script that will be used by your Template Fragment.

You can then add fields within the Custom section of your Template Fragment that refer to the data returned by the Script.

 

Custom Script Fragments

Notes

Custom Queries and the Custom template section can only be used in Template Fragments; they cannot be used in normal, full-document templates
Custom Queries can reference the ID of the element or Package currently being processed by the document template, using the #OBJECTID# or #PACKAGEID# macros
#Branch# gets the IDs of the child Packages of the current Package being processed, working recursively down to the lowest level of sub-Package; this is only valid when processing a Package - elements return a 0 value
#UserName# gets the name of the user logged into version control
#Author# takes the user name from the Author field in the General page of the Options dialog, so the defined search can be performed on objects created by that user (this value can be manually re-set in the Options dialog)
#Package# gets the package_ID of the currently-selected Package
 

Learn more

Learning Center topics

Alt+F1 | Enterprise Architect | Reporting | RTF Template Fragments |
Create a SQL based Fragment 1
Create a SQL based Fragment 2
Create a Script Fragment 1
Create a Script Fragment 2