To create a custom macro
1.
On a flowchart page in Edit mode, click the Options icon and select Custom Macros.
The Custom Macros dialog appears, displaying existing custom macros.
2.
Click New Item.
3.
From the Save Under drop-down list, select the folder location to which you want to save the custom macro.
4.
In the Name field, enter a name and declaration for the custom macro so that it can be referenced, using the following syntax:
MacroName(var1,var2,...)
Only the name of the custom macro (which must be unique) and the list of variables need to be expressed.
The MacroName must be alphanumeric. You cannot use spaces in the MacroName string, but you can use underscores (_).
*
*
5.
From the Security Policy drop-down list, select a security policy for the new custom macro.
6.
Optionally, use the Note field to enter any notes for the new custom macro, providing a clear explanation of what the custom macro is designed to do and what each variable represents.
7.
From the Expression Type drop-down list, select the type of custom macro you are creating.
*
If you select Raw SQL Selecting ID List, you must also select a database from the drop-down list in the Database field.
*
If you select Raw SQL Selecting ID + Value, you must also select a database from the drop-down list in the Database field and select the value type of the field from the Value Type drop-down list. Ensure that the value type you select here is correct. Otherwise, when you later attempt to profile this query, you will get a "Mismatched Type" error.
*
If you selected Text as the value type, specify the width of the value type in bytes in the Width (# Bytes) field. You must obtain this width in bytes information from the database. If you do not have access to the database or are unable to obtain the information, enter 256, the maximum width.
8.
Click inside the Expression field to open the Specify Selection Criteria window.
9.
*
Example: Custom macro that uses raw SQL selecting an ID and a value
Custom macro that uses raw SQL selecting an ID and a value
10.
Click Save to save the custom macro.
The custom macro is then stored, and can be accessed by its name.
11.
Click Close to exit the Custom Macros dialog.