LOOKUPTABLEVALUE2_DEFAULT
Syntax
LOOKUPTABLEVALUE2_DEFAULT (table_name, expression, default_value)
Description
Takes a value in column 1 of the named lookup table to find the value in column 2.
Arguments
table_name | The name of the lookup table. |
expression | A value in column 1 of the named lookup table. The value can be any string expression. |
default_value | The value to insert if no there is no matching value in column 1. |
Returns
Either:
- A string with the corresponding value in column 2 of the lookup table.
- The default value if there is no matching value in column 1.
Remarks
If the lookup value or the value being looked up is a NULL, the value is converted to its native data type, and then, if necessary, converted to a string before it is used in the lookup. Before the lookup occurs, if the source value is:
- A NULL of type int, it is converted to a 0.
- A NULL of type string, is converted to an empty string.
If the value in the expression argument is listed more than once in the lookup table, TIBCO Cloud™ Integration - Connect returns a row error.
Examples
If MyLookupTable contains the following data:
Column1 | Column2 |
---|---|
1 |
Manager |
2 |
Vice President |
3 |
Exec VP |
4 |
CEO/Pres |
LOOKUPTABLEVALUE2_DEFAULT ("MyLookupTable", "5", "UNKNOWN")
Returns: "UNKNOWN"
For the same lookup table:
LOOKUPTABLEVALUE2 ("MyLookupTable", "3" , "UNKNOWN")
Returns: Exec VP