On 23/02/2021 10: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).
> 

CAST(CAST(1 AS SMALLINT) AS BLOB SUB_TYPE BINARY) is same as '1'.

Maybe what you want is this?

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


Adriano


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

Reply via email to