Reputation: 43
I have the following statement for a MySQL DB.
if(cms_hagent.ti_availtime > '0',1,0) as "Total Available Time"
I need to convert it to query an Informix DB. Any suggestions on the proper syntax?
Upvotes: 2
Views: 4361
Reputation: 1101
On Informix 12.10 and higher, you can use IF statements (in the context of SPL routines) directly with the following syntax:
IF [condition] THEN
[action]
ELIF [condition] THEN --optional
[action]
END IF
The documentation further states:
The expression in an IF statement can be any valid condition, as the Condition segment of the IBM® Informix® Guide to SQL: Syntax describes. For the complete syntax and a detailed discussion of the IF statement, see the IBM Informix Guide to SQL: Syntax
Upvotes: 0