I am using a decode function in Informix database. I am retrieving a field which is an integer datatype. If the value I retrieved is ''
then I need to set it as null; if not I am setting the same value.
I tried like this:
decode(table1.field1,'',NULL,table1.field1)
but I am getting the following error
Corresponding types must be compatible in CASE expression.
I am confused how the value will be retrieved from database — as null or as 0 or -1 or something. Do I need to do like this?
decode(table1.field1,'',0,table1.field1)
how to resolve it