NULL Characters in Firebird VARCHAR

I am trying to find entries in a VARCHAR column that may contain NUL (0x00), and I cannot find a way to find the NUL character.

Any ideas are welcome.

-Israel

+4
source share
1 answer

Firebird comes with an external function library (UDF library) that has an ASCII_CHAR function. You should declare it in your database as follows:

DECLARE EXTERNAL FUNCTION ascii_char INTEGER RETURNS CSTRING(1) FREE_IT ENTRY_POINT 'IB_UDF_ascii_char' MODULE_NAME 'ib_udf'; */ 

Then you can try to execute the query:

 select * from yourtable where column like '%' || ASCII_CHAR(0) || '%' 

or something similar...

I must admit that I have not tried, but you could tell us the results :)

+2
source

Source: https://habr.com/ru/post/1303173/


All Articles