The CASE statement within SPL is a long overdue request for many Informix users. Finally this wish fulfilled in Informix release 12.10. Now you can use the CASE statement within SPL routines as a faster alternative to IF...ELSE…END IF statements to define a set of conditional logical branches. The syntax for the CASE statement is:
You can use the CASE statement to create a set of conditional branches. The WHEN and the ELSE clauses are optional, but you must include at least one of them.
Here is an example that demonstrates how to use the case statement within SPL. In this example, the CASE statement validates a variable named ‘user’ and reassign the value of same variable. It also includes a test for NULL value.
This enhancement in the SPL code is really helpful for migrate databases from Informix XPS and other database servers to Informix server. For more information please check the Informix Information Center.