On 23-02-2021 14:37, Jiří Činčura wrote:
Or maybe not. Any smart way to make something like this work? Maybe I just 
don't see it.

SELECT POSITION(CAST(CAST(1 AS SMALLINT) AS BLOB SUB_TYPE BINARY), CAST(x'0001' 
as blob sub_type binary)) FROM rdb$database

The `CAST(1 AS SMALLINT)` is, at the moment constant byte value I'm getting 
(hence I could generate x'...' literal), but it can be i.e. column (and hence 
the literal approach would not work).


Using 1 will cast to string first, so it'll look for 0x31 (hexadecimal for ASCII character '1'), for a dynamic value, use ASCII_CHAR, e.g. ASCII_CHAR(1).

Mark
--
Mark Rotteveel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to