Subject Re: [firebird-support] Invalid request BLR at offset XXXX in firebird 1.0x not in 1.5
Author Arno Brinkman
Hi,

> I use a stored procedure to concat 2 fields where the second can have
> NULL value.
> But I have an Invalid request BLR at offset XXXX when I try to use a
> Distinct clause.
>
> For example :
> select distinct Q2.*,(select FIRSTLASTNAME from CONCAT_FIRSTLASTNAME
> (Q2.FIRSTNAME ,Q2.LASTNAME)) R_FIRSTLASTNAME
> from CUSTOMER Q2

This is a known bug, DISTINCT on sub-select in select list.

As workaround you could use a LEFT JOIN instead :

SELECT
DISTINCT
Q2.*,
cfl.FIRSTLASTNAME AS R_FIRSTLASTNAME
FROM
CUSTOMER Q2
LEFT JOIN CONCAT_FIRSTLASTNAME(Q2.FIRSTNAME ,Q2.LASTNAME) cfl ON (1 = 1)


Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81