Progress
SQL-92
Guide and Reference
DECODE Function
Compares the value of the first argument expression with each search_expression and, if a match is found, returns the corresponding match_expression. If no match is found, then the function returns the default_expression. If a default_expression is not specified and no match is found, the function returns a null value.
SYNTAX
EXAMPLE
This example illustrates one way to use the DECODE function:
NOTES
- Use a simple case expression when SQL-92-compatible syntax is a requirement.
- The first argument
expression
can be of any type. The types of allsearch_expressions
must be compatible with the type of the first argument.- The
match_expressions
can be of any type. The types of allmatch_expressions
must be compatible with the type of the firstmatch_expression
.- The type of the
default_expression
must be compatible with the type of the firstmatch_expression
.- The type of the result is the same as that of the first
match_expression
.- If the first argument
expression
is null, then the value of thedefault_expression
is returned, if it is specified. Otherwise null is returned.COMPATIBILITY
Progress Extension
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |