PowerCenter
- PowerCenter 10.5.7
- All Products
DECODE(value,first_search,first_result[,second_search,second_result]...[,default] )
Argument
| Required/
Optional
| Description
|
---|---|---|
value
| Required
| Any datatype except Binary. Passes the values you want to search. You can enter any valid transformation expression.
|
search
| Required
| Any value with the same datatype as the value argument. Passes the values for which you want to search. The search value must match the value argument. You cannot search for a portion of a value. Also, the search value is case sensitive.
For example, if you want to search for the string 'Halogen Flashlight' in a particular port, you must enter 'Halogen Flashlight, not just 'Halogen'. If you enter 'Halogen', the search does not find a matching value. You can enter any valid transformation expression.
|
result
| Required
| Any datatype except Binary. The value you want to return if the search finds a matching value. You can enter any valid transformation expression.
|
default
| Optional
| Any datatype except Binary. The value you want to return if the search does not find a matching value. You can enter any valid transformation expression.
|
DECODE ( CONST_NAME 'Five', 5, 'Pythagoras', 1.414213562, 'Archimedes', 3.141592654, 'Pi', 3.141592654 )
DECODE ( CONST_NAME 'Five', 5, 'Pythagoras', '1.414213562', 'Archimedes', '3.141592654', 'Pi', 3.141592654 )
Function cannot resolve operands of ambiguously mismatching datatypes.
DECODE( ITEM_ID, 10, 'Flashlight', 14, 'Regulator', 20, 'Knife', 40, 'Tank', 'NONE' )
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DECODE( TRUE, Var1 = 22, 'Variable 1 was 22!', Var2 = 49, 'Variable 2 was 49!', Var1 < 23, 'Variable 1 was less than 23.', Var2 > 30, 'Variable 2 was more than 30.', 'Variables were out of desired ranges.')
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|