Introducing Agent Safe Governance for the AI Era

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

name

String

Yes

Macro name. Must be a valid Teradata identifier: starts with a letter or underscore, contains only letters, digits, and underscores.

schemaName

String

No

Database or schema containing the macro. When provided, the macro is referenced as schemaName.name. Must be a valid Teradata identifier.

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

name

String

Yes

Parameter name. Used for documentation and readability only; not included in the generated SQL.

value

String

Yes

Parameter value.

type

String

No

Controls how value is formatted in the generated EXEC statement. STRING wraps the value in single quotes and escapes internal single quotes. NUMERIC inserts the value without quotes. DATE, TIMESTAMP, and TIME prefix the value with the type keyword. Accepted values: STRING, NUMERIC, DATE, TIMESTAMP, TIME. Default: STRING.

Example code

Be sure to replace your_table, your_author, and your_schema with your actual values.

loading

loading

loading

loading