Subject | Re: [firebird-support] Re: coalesce |
---|---|
Author | Mark Rotteveel |
Post date | 2015-03-25T18:46:51Z |
On 25-3-2015 19:25, Dmitry Yemanov dimitr@...
[firebird-support] wrote:
using EXECUTE BLOCK, then a COALESCE(anullvarchar10, 'NULL') will result
in a VARCHAR(10) that is not padded to spaces. Using a CHAR(10) will -
as expected - pad with spaces.
It seems to depend on the context of the query, or that
variablevarchar(10) is not actually varchar(10), but char(10).
Mark
--
Mark Rotteveel
[firebird-support] wrote:
> 25.03.2015 19:43, 'checkmail' wrote:If I test something similar on Firebird 3 and 2.5 using a select and
>
>> one short question, why is the Result of
>> coalesce(:variableVarchar(10),‘NULL‘) not ‚NULL‘ but rather ‘NULL ‘
>> with blanks from varchar(10) length?
>
> Because the resulting length is determined by the longest argument. It's
> fixed at the compile time.
using EXECUTE BLOCK, then a COALESCE(anullvarchar10, 'NULL') will result
in a VARCHAR(10) that is not padded to spaces. Using a CHAR(10) will -
as expected - pad with spaces.
It seems to depend on the context of the query, or that
variablevarchar(10) is not actually varchar(10), but char(10).
Mark
--
Mark Rotteveel