Subject | Re: [firebird-support] Result type of RPAD() and LPAD() |
---|---|
Author | Paul Vinkenoog |
Post date | 2011-01-10T11:08:52Z |
Hello Chris,
I didn't know that it was backported to 2.1.4 as well.
You can forget the casts, then.
Cheers,
Paul Vinkenoog
> In the documentation for LPAD and RPAD is written that the result type is VARCHAR(32765) and there is a tip to cast the result to a useful length.In Firebird 2.5, the result is VARCHAR(n) with n equal to the second argument.
>
> When using LPAD or RPAD in a "SELECT LPAD( LABEL, 8, '-' ) FROM...", FlameRobin and IBExpert both return a VARCHAR(8), corresponding to the length argument of xPAD(), without casting.
>
> My question: is the cast still recommended or obsolete?
I didn't know that it was backported to 2.1.4 as well.
You can forget the casts, then.
> I use the internal functions. Is the behavior different if I use the external functions from ib_udf.dll?Yes. You declare them with the desired output length. But don't bother with them. Stick to the internal functions, since they behave so well now.
Cheers,
Paul Vinkenoog