Subject SUBSTRING returning BLOB in FB2.5
Author gordon@gniessen.com
I have a query that uses a case statement to return either a varchar
field or a substring of a BLOB, depending on if the blob is null. And
in FB 1.5 this returned a varchar. But when testing on an upgraded
version using FB 2.5 I am getting a BLOB field type for the column.
Is there anyway to avoid this?

SELECT
CASE WHEN (LC.OLD_VALUE_BLOB IS NULL) THEN LC.OLD_VALUE ELSE
SUBSTRING(LC.OLD_VALUE_BLOB FROM 1 FOR 40)||'...' END AS OLD_VALUE,
CASE WHEN (LC.NEW_VALUE_BLOB IS NULL) THEN LC.NEW_VALUE ELSE
SUBSTRING(LC.NEW_VALUE_BLOB FROM 1 FOR 40)||'...' END AS NEW_VALUE,
FROM LOG_COLUMN LC;


Thanks
Gordon