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
- Click Functions on the Model menu.
The Teradata Function Editor opens.
- Select a function and work with the following options:
Click New
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.
- 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.
This property only displays if the function type is set to scalar.
- Character Set Type
Specifies the character set type.
This property only displays if the function type is set to scalar.
- Return Cast Data Type
Specifies casting from data type.
This property only displays if the function type is set to scalar.
- Return Cast User Defined Type
Specifies the data-type/domain casting from.
This property only displays if the function type is set to scalar.
- Return Cast Character Set Type
Specifies the character set type casting from.
This property displays only if the function type is set to scalar.
- Return Type
Specifies the data-type/domain that will be returned.
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.
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.
This property only displays if the function type is set to table.
- Work with other tabs in the editor to access additional design features, for example:
- Add or edit parameters for the selected function on the Parameters tab.
- Work with data access features for the selected function on the Options tab.
- Add a full path for source files for the selected function on the Source Files tab.
- Add external files for the selected function on the External tab.
- Edit the SQL code related to the selected function on the Code tab.
- Display fully expanded code that may be shown as code fragments or partial routines on other tabs, on the Expanded tab.
- Associate permissions with the selected function on the Permission tab.
- Change the object creation order in the Object Creation Order tab.
- (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
- (Optional) Click the UDP tab to work with user-defined properties for the object.
- (Optional) Click the Notes tab to view and edit user notes.
- Click Close.
The Teradata Function Editor closes.
Copyright © 2023 Quest Software, Inc. |