views:

120

answers:

2

Hello there,

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

Any ideas are welcome.

-Israel

A: 

have you read this Firebird Null Guide

drorhan
I looked at that, im looking for a NUL (0x00) character, not the concept of NULL in a column.The source of the problem is this: org.jdom.IllegalDataException: The data "ThisSTRINGWITHA NULLCHAR" is not legal for a JDOM character content: 0x0 is not a legal XML character.The string doesnt seem to contain a NUL, but it may reside in other tables that I need to search.
Israel Lopez
+1  A: 

Firebird comes with an external function library (UDF library) that has an ASCII_CHAR function. You have to declare it in your database like this:

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

Then, you could try querying:

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

or something similar...

I must admit I haven't tried it, but you could and let us know the results :)

Martijn Tonies
This worked beautifully. Thanks I didnt know that UDF function was available.
Israel Lopez