Define a Teradata Macro

You can use the Macro editor to define a set of statements that are frequently used or that perform a complex operation in a Teradata physical model.

To define a Teradata macro

  1. Click Macros on the Database menu.

    The Macro Editor opens.

  2. Select a macro and work with the following options:

    Note: Click New <New> icon in property editors on the toolbar to create a new macro.

    Name

    Specifies the name of the macro.

    Database

    Specifies the schema of the database to which the table belongs. Select from the drop-down.

    Type

    Shows the type (Model Level or Table Level).

    Attach To New

    Specifies if upon creating a new (table-level only) table, this script will automatically be attached to it.

    Enabled

    Specifies if the macro is enabled or not.

    Use Replace Syntax

    Lets you select whether Forward Engineering will use the REPLACE command instead of the CREATE command.

    Generate

    Generates DDL for this object during Forward Engineering.

  3. Enter the macro code in the text area on the Code tab. Click the Text Editor icon Text Editor Icon to work with the macro code in a larger box. Click the Macro Toolbox icon Macro Toobox to open the Macro Toolbox where you can select and insert a pre-configured toolbox macro.

    You can work with the other tabs in the editor to access additional design features, for example:

  4. (Optional) Click the Comment tab and enter any comments you want associated with the macro.
  5. (Optional) Click the UDP tab to work with user-defined properties for the macro.
  6. Click Close.

    The Macro Editor closes.

More information:

Edit Code in a Teradata Property Editor

View Expanded Code in a Property Editor

View Parameters Associated with the Selected Function

Add Permissions in a Teradata Property Editor

Add a Comment in a Property Editor

Change the Object Creation Order in a Property Editor

Add a UDP in a Physical Property Editor