On 2021-02-23 10:27, Jiří Činčura wrote:
Hi *,
is there a reason why POSITION does not work on binary blobs? I would
expect something like `POSITION(blob, 0x1)` to work.
Did you mean POSITION(blob, x'01'), because I wouldn't expect 0x1 (an
integer literal) to work.
In any case, the problem is that you have switched the parameters. The
correct order would be POSITION(x'01', blob).
The syntax is:
POSITION (substr IN string)
| POSITION (substr, string [, startpos])
So the string you're searching for should be first, the string you're
searching in must come second.
See also
https://www.firebirdsql.org/file/documentation/html/en/refdocs/fblangref25/firebird-25-language-reference.html#fblangref25-functions-scalarfuncs-position
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel