You can add a user-defined function to a transformation or field expression.
When you create an expression, valid user-defined functions appear in the expression editor. If you type in an expression manually, precede each user-defined function with :UDF.
The following image shows a user-defined function selected in the expression editor of an Expression transformation:
When you select a user-defined function, the expression editor shows the function syntax in the following format:
<function name> (<argument 1> as <data type>, <argument N> as <data type>)
For example:
RemoveSpaces(TextString as string)
When you add the function to the expression, the function includes the prefix :UDF, as shown in the following example:
:UDF.RemoveSpaces(TextString)
After you add the function to the expression, replace the arguments with field names or parameters. Do not include the table name in the argument. Use only the field name as shown in the following example:
:UDF.RemoveSpaces(NAME)
For more information about creating expressions, see
Tasks
.
When you validate the expression,
Data Integration
does not validate the user-defined function. It only validates the expression.