Reporting Dashboards supports the use of system-created macros that are evaluated when the a Custom SQL Query data provider is used to return data for a dashboard. Macros are expanded and replaced with the valid SQL functions or expressions they represent, saving time when writing custom SQL and making the SQL easier to maintain. Some macros accept arguments that are used to control how the macro is expanded, but not all macros accept arguments. Macros can be used anywhere in a SQL statement.
When editing a Custom SQL Query data provider, macros can be added in by right clicking and selecting Insert Macro from the menu. The options for each macro selectable from the Insert Macro menu are noted in each description of the macros.
Macros are included with Reporting Dashboards and cannot be created or changed by users.
The macros available and how they are used are described in the following sections. The following limitations and rules apply to the use of macros:
-
Macro names are case sensitive and must be included exactly as presented in the following sections.
-
Macros cannot be nested (i.e., one macro cannot be used as an argument to another macro).
-
Macros can contain dynamic parameters (see Query Parameterization).
-
Macro values are treated as text unless a dynamic parameter returns a non-text value.
-
To prevent a macro from being expanded, prepend an additional # symbol before the macro name. For example, ###OB_CURRENTUSER_ID.
-
Macro expansion always occurs before parameter expansion (see Query Parameterization).
See also, Debugging SQL Query Macros.