Hi Thomas

You're right, with version 1.3.175 an empty string is treated like NULL in 
Oracle compatibility mode :-)

What is strange, is that after closing the connection with Oracle 
compatibility mode and reconnecting to H2 (Embedded or Generic) the 
following statement also retruns TRUE:

select true as result where '' is NULL;

Only after a shutdown of h2 the behavior in H2 (Embedded or Generic) is as 
expected, i.e. the statement above returns nothing. This not only happens 
when using the web H2 console but also when connecting from another client 
(eg. DBeaver).

Regards,
Mike

Am Samstag, 15. Februar 2014 20:46:02 UTC+1 schrieb Thomas Mueller:
>
> Hi,
>
> This feature was added in version 1.3.175. You are using 1.3.174, where it 
> is not yet available.
>
> See also http://www.h2database.com/html/changelog.html "Issue 522: Treat 
> empty strings like NULL in Oracle compatibility mode, patch by Daniel 
> Gredler."
>
> Regards,
> Thomas
>
>
>
> On Sat, Feb 15, 2014 at 3:51 PM, Mike Cobo <[email protected]<javascript:>
> > wrote:
>
>> Hi Thomas,
>>
>>
>> The documentation says that for Oracle compatibility mode:
>>
>>    - Empty strings are treated like NULL values. 
>>
>> But in the following cases an empty string in Oracle compatibility mode 
>> seems not to be treated like NULL.
>>
>> The following query in Oracle DB returns true, whereas in H2 with 
>> MODE=Oracle doesn't: 
>> SELECT true AS result WHERE '' IS NULL;
>>
>> And the following query in Oracle DB returns nothing (empty result set), 
>> whereas in H2 with MODE=Oracle returns true:
>> SELECT true AS result WHERE '' = '';
>>
>> The same behaviour appears when reading the values from a table. 
>> And when inserting an empty string in H2 with MODE=Oracle it is not 
>> converted to NULL whereas in Oracle DB NULL is stored and not an empty 
>> string.
>> The statements where executed on H2 1.3.174 (2013-10-19)
>>
>> Do I need do set any other parameter for the compatibility mode to work 
>> correctly or is it simply not working  yet?
>>
>> Regards,
>> Mike
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>>
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to