Subject Re: [IBO] A possible issue
Author setysvar
>If I try compare a Param with NULL, in a TIBOQuery, like below, I get
the error:
>
>E_UNSUPPORTED_COLUMN "Unsupported column type: 32767"
>
>SELECT *
>FROM FOO
>WHERE ((ID = :PARAM) OR (:PARAM = 0) OR (:PARAM IS NULL))
>
>In the IBExpert, the SQL run normally.

Parameters aren't variables, they're placeholders (even though Jason has
improved IBOs handling of them). So, your first reference to :PARAM
isn't necessarily the same as the second or third. I think (don't know)
the reason for your error is because ID and 0 probably are integers,
hence the first two times you refer to PARAM, Firebird knows that these
are integers and having the same name, IBO treats them as if they were
variables. NULL, however, doesn't say anything about type, so Firebird
doesn't know that the third PARAM should be an integer. Your report
makes me suspect that IBO lets Firebird first prepare the statement
before doing its magic so that the placeholders may seem to be
variables. The way to avoid your error is to tell Firebird what type the
last occurence of your parameter is:

WHERE ((ID = :PARAM) OR (:PARAM = 0) OR (CAST(:PARAM AS INTEGER) IS NULL))

HTH,
Set