Subject Re: [ib-support] Substring?
Author Claudio Valderrama C.
"Joe Martinez" <joe@...> wrote in message
> I'm trying to remove the first 3 characters characters from the
> beginning of a VARCHAR string for a set of records.

update mytable
set myfield = substring(myfield from 4)

update mytable
set myfield = substr(myfield, 4, 32765)

update mytable
set myfield = substrlen(myfield, 4, 32761)

The bold note is that neither of them work with IB, but with FB:
- substring is the ANSI SQL function implemented in FB.
- substr in IB will return NULL if the end position is greater than the
field's length; FB substr will return from start to end_pos or end of
string, whatever happens first. It seems more sensible.
- substrlen is a variation devised for FB. Instead of working as
(s,begin_pos,end_pos), it works as (s, begin_pos,length).

Claudio Valderrama C. - -
Independent developer
Owner of the Interbase® WebRing