concat NULL string

Hi,

I try with query builder to concat some text and number fields together. It works as long as the fields are not null. If one of the fields is null, to complete concated string is null.
query.result.add(query.columns.field1.concat(’ ‘).concat(query.columns.field2).concat(’ ').concat(

query.result.add(query.columns.field1.concat(’ ‘).concat(query.columns.field2).concat(’ ‘).concat(query.columns.field3).concat(’ ').concat(query.columns.field4));

In my situation field4 can be sometimes null.

I know this is standard sql behavior.
I have tried to cast the field to QUERY_COLUMN_TYPES.TYPE_STRING and QUERY_COLUMN_TYPES.TYPE_TEXT, without any success.

Any ideas.
Thanks
Andre

Hi Andre,

You might want to look at the COALESCE() function. SQL has it, looks like QueryBuilder supports it as well.

Hope this helps.

Thanks Robert,
That works.
Andre