Case statement that assigns Nulls or time

14 views
Skip to first unread message

Gil Furman

unread,
Nov 24, 2020, 7:58:53 PM11/24/20
to dbfit
Hi all,

I've encountered the following issue. When running a query with a case statement like:
CASE ENDUZ
    When '' Then Null
    When '000000' Then Null
    ELSE CAST(Substr(ENDUZ, 1, 2) || ':' || Substr(ENDUZ, 3, 2) || ':' || Substr(ENDUZ, 5) AS TIME(6))
END AS END_TM.

I'm getting the following exception:
[Error 1063] [SQLState HY000] null is not supported as a data value with this variant of the setObject method; use the setNull method or the setObject method with a targetSqlType parameter 

is there anyway to overcome that? I tried casting it all to char on both sides but that didn't work. Happy for any ideas... thanks 
Reply all
Reply to author
Forward
0 new messages