bteqMacro
Last updated: June 9, 2026
Provides a structured way to execute Teradata macros through the BTEQ executor. Generates an EXEC statement with optional typed parameters, replacing the need to write <sql>EXEC MacroName(...);</sql> by hand.
The primary value is readability and parameter validation. Parameter names serve as documentation, and the type attribute controls how each value is formatted in the generated SQL.
Note: Macros are imperative operations with arbitrary side effects. Automatic rollback is not possible. Provide an explicit <rollback> block or use <rollback/> to acknowledge irreversibility.
Available attributes
Attribute | Type | Required | Description |
| String | Yes | Macro name. Must be a valid Teradata identifier: starts with a letter or underscore, contains only letters, digits, and underscores. |
| String | No | Database or schema containing the macro. When provided, the macro is referenced as |
Param attributes
Each <pro-teradata:param> element defines a positional parameter passed to the macro. Parameters are included in the EXEC statement in the order they appear in the XML.
Attribute | Type | Required | Description |
| String | Yes | Parameter name. Used for documentation and readability only; not included in the generated SQL. |
| String | Yes | Parameter value. |
| String | No | Controls how |
Example code
Be sure to replace your_table, your_author, and your_schema with your actual values.