Christian Waldmann wrote:

In the documentation for LPAD and RPAD internal functions is written that the result type is VARCHAR(32765) and there is a tip to cast the result to a useful length.

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 (Firebird v2.1.4).

My question: is the cast still recommended or obsolete?

Paul Vinkenoog answers:

In Firebird 2.5, the result is VARCHAR(n) with n equal to the second argument. Strings longer than n will be truncated. It seems that it was backported to 2.1.4 as well.

Like this post? Share on: TwitterFacebookEmail

Related Articles


Firebird Community



Gems from Firebird Support list