On 25-3-2015 19:25, Dmitry Yemanov [email protected] 
[firebird-support] wrote:
> 25.03.2015 19:43, 'checkmail' wrote:
>
>> 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.

If I test something similar on Firebird 3 and 2.5 using a select and 
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


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Reply via email to