Data Type, Precision, and Scale of Field Expressions
Data Type, Precision, and Scale of Field Expressions
In the Expression Editor, you add fields as an expression operand or as a parameter to a PowerCenter function. The field data types and the function return types must be compatible with the data type of the expression result. Additionally, the precision and scale of the expression must be adequate to accommodate the expression result. Incompatibilities can result in a truncated result or test errors.
The following image shows the
Expression Editor
dialog box:
Fields tab
Functions tab
Expression text box
Field properties
PowerCenter transformation data type for the expression
Precision of the PowerCenter transformation data type
Scale of the PowerCenter transformation data type
The Expression Editor retrieves fields from the table on which you are running a test. The Expression Editor also displays the properties that the data source associated with the fields when PowerCenter retrieved the fields from the source. The field properties include the data type, precision, and scale of the field.
Precision is the maximum number of significant digits for numeric data types, or the maximum number of characters for string data types. Precision includes scale.
Scale is the maximum number of digits after the decimal point for numeric values. Therefore, the value 11.47 has a precision of 4 and a scale of 2. The string
Informatica
has a precision (or length) of 11.
After Data Validation Option processes an expression, it stores the expression result in a field that has a PowerCenter transformation data type. Data Validation Option also applies the precision and scale of the PowerCenter data type to the expression result. Therefore, when you create an expression, you must know the properties of the fields that you add, and you must set the data type of the expression to a compatible PowerCenter data type. You must also set the precision and scale to values associated with the PowerCenter transformation data type.
The following image shows the PowerCenter transformation data types:
After you create an expression, you can it.
You can validate the expression and not the type, precision, or scale.