Using PowerCenter User-Defined Functions in Data Validation Option
Using PowerCenter User-Defined Functions in Data Validation Option
You can create a user-defined function in PowerCenter and use it in Data Validation Option.
In the Data Validation client, right-click the target PowerCenter repository and select
Edit Repository
to view the name of the folder where you can create the user-defined function.
The following image shows the target folder for the PowerCenter repository:
In PowerCenter, go to the target folder of the repository that you use for Data Validation Option.
The following image shows the properties of the user-defined function:
Save the user-defined function and disconnect from the target folder.
Data Validation Option generates and writes objects to the target folder. If the target folder is open in the PowerCenter repository, a locking error occurs.
In Data Validation Option, go to the location where you want to use the user-defined function.
You can call the user-defined function from any valid location, such as a WHERE clause, an expression in a value test, or a test condition.
To call the user-defined function, use the syntax
:UDF.<function name>(<parameters>)
For example, if the name of the function is ALLTRIM, use the expression
:UDF.ALLTRIM(FIRSTNAME)
The following image shows the user defined function called from an expression in a value test:
Ensure the data type, precision, and scale are appropriate for the function and match the return type correctly.