The string returned is of VARCHAR2 datatype and is in the same character set as the first result parameter. expr, search, and result can be any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2. If expr and search are character data, then Oracle compares them using nonpadded comparison semantics. The arguments can be any of the numeric types ( NUMBER, BINARY_FLOAT, or BINARY_DOUBLE) or character types. If default is omitted, then Oracle returns null. If no match is found, then Oracle returns default.
If expr is equal to a search, then Oracle Database returns the corresponding result. Description of the illustration decode.gifĭECODE compares expr to each search value one by one.