Subject Problem with substr UDF
Author Jacek Borowski
Hi,

In my FB server ver. 1.5.2 I have UDF Substr declared as:

DECLARE EXTERNAL FUNCTION SUBSTR
CSTRING(32767),
SMALLINT,
SMALLINT
RETURNS CSTRING(32767) FREE_IT
ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf'

I have problem with query:

select substr(opis,1,50),substr(khnip,1,20),substr(khkod,1,50)
from dk
it returns error:
invalid request BLR at offset 38.
Implementation limit exceeded.
block size exceeds implementation restriction

while in this case :

select cast(substr(opis,1,50) as varchar(50))
,cast(substr(khnip,1,20) as varchar(20))
,cast(substr(khkod,1,50) as varchar(50))
from dk

all is OK.

Does it mean that substr returns 32767 bytes ?

select strlen(substr(opis,1,50)) from dk returns 50 ?

Query containing more then one Substr call doesn't work.

Is it expected behaviour, or may be something is wrong ?

Regards,
Jacek Borowski



[Non-text portions of this message have been removed]