Table of Contents

Search

  1. Preface
  2. Using the Designer
  3. Working with Sources
  4. Working with Flat Files
  5. Working with Targets
  6. Mappings
  7. Mapplets
  8. Mapping Parameters and Variables
  9. Working with User-Defined Functions
  10. Using the Debugger
  11. Viewing Data Lineage
  12. Comparing Objects
  13. Managing Business Components
  14. Creating Cubes and Dimensions
  15. Using the Mapping Wizards
  16. Datatype Reference
  17. Configure the Web Browser

Designer Guide

Designer Guide

Creating Expressions with User-Defined Functions

Creating Expressions with User-Defined Functions

You can add a user-defined function to an expression. If you enter a user-defined function when you manually create an expression, you must prefix the user-defined function with :UDF. When you create an expression with the Expression Editor, valid user-defined functions display on the User-Defined Functions tab. Use user-defined functions as you would any other function.
If you create a user-defined function, which is only usable in the Designer, the function only displays in the Designer.
When you select a user-defined function, the Expression Editor shows the function syntax in the following format:
<return datatype> <function name> (<argument 1> as <datatype>, <argument N> as <datatype>)
For example:
NSTRING RemoveSpaces(NAMES as string)
When you add the function to the Formula window, the function includes the prefix :UDF, as in the following example:
:UDF.RemoveSpaces( )
When you validate the expression, PowerCenter does not validate the user-defined function. It only validates the expression.

0 COMMENTS

We’d like to hear from you!