Hi,

H2 supports both depending on the compatibility mode. See
http://www.h2database.com/html/features.html#compatibility

"Concatenation with NULL results in NULL. Usually, NULL is treated as
an empty string if only one of the operands is NULL, and NULL is only
returned if both operands are NULL."

To use this mode, add the following to the database URL: ;MODE=HSQLDB
(or PostgreSQL).

Is it this really how Microsoft SQL Server behaves by default? If yes
I will add the flag to the MSSQLServer mode as well.

Regards,
Thomas


On Fri, Sep 18, 2009 at 1:52 PM, Duvel <[email protected]> wrote:
>
> Hello,
>
> Today I found out that Oracle didn't follow the SQL-standard for
> string concatenation and thus creating unexpected behaviour in our
> application. I immediately tested this as well in other databases like
> SQL Server, PostgreSQL and H2. Both SQL Server and PostgreSQL work
> according the SQL-standard, but H2 also didn't follow the SQL-
> standard.
>
> If you concatenate a NULL-value with a string, this should return
> NULL. H2 returns in this case a string, which is wrong according the
> SQL-standard. It is easy to test with this statement which should
> return null and not 'aap':
>
> select null || 'aap'
>
> Some more info about string concatenation in SQL:
> http://troels.arvin.dk/db/rdbms/#functions-concat
>
> Kind regards,
>
> Remco Schoen
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to