Previous Topic: Define the Physical Location of a Teradata FileNext Topic: Specify Data Access Options


Add User-Defined Teradata Functions

You can use the Teradata Function Editor to create and maintain the user-defined functions in a Teradata physical model.

To add user-defined Teradata functions

  1. Click Functions on the Model menu.

    The Teradata Function Editor opens.

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

    Note: Click New New icon in property editors to create a new object on the toolbar to create a new function. Use the Enter filter text text box to filter a very large list of functions to quickly locate the one you want to work with.

    Name

    Specifies the name of the function.

    Database

    Specifies the database or user.

    Type

    Specifies the type of the function. Select from the drop-down list. Valid values are: Model Level or Table Level.

    Function Type

    Specifies the function type. Select from the drop-down. Valid values are Scalar or Table.

    Enabled

    Specifies if the function is enabled or not.

    Use Replace Syntax

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

    Attach To New

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

    Generate

    Generates DDL for this object during Forward Engineering.

    Generate As Pre-Script

    Specifies whether you want to generate DDL as pre-script. Valid values are Post Creation and Pre Creation.

  3. Complete the following fields on the General tab:
    Function Type

    Specifies the function type. Select from the drop-down. Valid values are Scalar or Table.

    Specific Name

    Specifies the specific function type selected in the previous field.

    Return Data Type

    Specifies the data type for the value returned by the function. Distinct and structured UDT's are valid for scalar function only.

    Note: This property only displays if the function type is set to scalar.

    Character Set Type

    Specifies the character set type.

    Note: This property only displays if the function type is set to scalar.

    Return Cast Data Type

    Specifies casting from data type.

    Note: This property only displays if the function type is set to scalar.

    Return Cast User Defined Type

    Specifies the data-type/domain casting from.

    Note: This property only displays if the function type is set to scalar.

    Return Cast Character Set Type

    Specifies the character set type casting from.

    Note: This property displays only if the function type is set to scalar.

    Return Type

    Specifies the data-type/domain that will be returned.

    Note: This property only displays if the function type is set to scalar.

    Return Table Definition (Teradata Version 12 only)

    Defines a reference to a table that will define the table that the function will return.

    Note: This property only displays if the function type is set to table.

    Return Table Varying Columns (Teradata Version 12 only)

    Defines a reference to a table that will define the varying columns that the function will return.

    Note: This property only displays if the function type is set to table.

  4. Work with other tabs in the editor to access additional design features, for example:
  5. (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
  6. (Optional) Click the UDP tab to work with user-defined properties for the object.
  7. (Optional) Click the Notes tab to view and edit user notes.
  8. Click Close.

    The Teradata Function Editor closes.

More information:

Specify Data Access Options

Specify Source Files for a Physical Object

Specify External Files for a Physical Object

Specify Parameters for the Selected Physical Object

Edit Code in a Teradata Property Editor

View Expanded Code in a Property Editor

Add Permissions in a Property Editor

Change the Object Creation Order in a Property Editor

Add a Comment in a Property Editor

Add a UDP in a Physical Property Editor