Subject Substring function cannot use UDF:s?? (FB 1.5)
Author Kjell Rilbe
Hi,

Firebird 1.5.

Is it true that you can't use a UDF inside a substring call? If so, why
not? Will it be changed so it works in newer releases?

Background:

I need to convert 'Lastname, Firstname' strings into 'Firstname Lastname'.

I first tried using a UDF that returns the pos of a string (the comma)
within another string (the 'Lastname, Firstname' value). I would the
use that UDF's return value in a substring call, like this:

substring(Name from PosUDF(',', Name) + 2 for 999)
|| ' ' ||
substring(Name from 1 for PosUDF(',', Name) - 1)

This didn't work because I got an error that said something like PosUDF
unknown identifier or something.

I've coded the whole thing into a UDF now, so the problem per se is
solved. I'd just like to know about substring and UDF:s...

Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64