Subject Re: [Firebird-Java] Query returning incorrect data
Author Roman Rokytskyy
> However I have the following query:
> "select (case when status=1 then 'Yes' else 'No' end) as FlagStr from
> mytable"
> I have a record in mytable where the status is 1. When I run the query
> in IBExpert it returns a column value of 'Yes', but when I run it via
> my application it returns 'Y'! Any idea why this is?
> I thought maybe it's a transcoding error, i.e because the jdbc
> encoding type is set to UNICODE_FSS that I need to cast the result of
> the case statement to UNICODE_FSS in some way but I cannot get it to
> work correctly. If this what I need to do, and if so, can someone give
> an example of how to do it? (Or have I encountered a jdbc bug?)

I suspect this is not a bug, but some inconsistency because of unicode
use... What is your JDBC URL/connection properties for Jaybird?

Also you can try

select (case when status=1 then _UNICODE_FSS 'Yes' else _UNICODE_FSS
'No' end) as FlagStr from mytable