Table of Contents

Search

  1. Preface
  2. Components
  3. API collections
  4. Business services
  5. File listeners
  6. Fixed-width file formats
  7. Hierarchical mappers
  8. Hierarchical schemas
  9. Industry data service customizer
  10. Intelligent structure models
  11. Refining intelligent structure models
  12. Mapplets
  13. Saved queries
  14. Shared sequences
  15. User-defined functions

Components

Components

Creating expressions with user-defined functions

Creating expressions with user-defined functions

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:
In this image, "User-defined functions" is selected in the drop-down list on the left. The user-defined function RemoveSpaces is selected in the list on the left and has been added to the expression on the right.
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 in-out parameters. Don't 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
doesn't validate the user-defined function. It only validates the expression.

0 COMMENTS

We’d like to hear from you!