Hi,

> When supplying binary/literal values in raw SQL (not using
> PreparedStatement), the H2 driver or database attempts parse them as a hex
> value; 'abcd' is parsed as 0xAB, 0xCD instead of 0x61 0x62 0x63 0x64.

Yes. Why don't you use a PreparedStatement?

> However as I recall the SQL spec saya literal binary data should be
> one-to-one ascii/iso8859-1 (0-255) char-equivs (including \0); the only
> exception being 0x27, which must be doubled of course..

That's interesting. Could you provide a link? I didn't find that in
the standard.

Unicode doesn't map all byte sequences to characters. Therefore you
couldn't generate some binary data when using UTF-8. Mapping one
character to one byte sounds wrong.

> My question is, is there any way now (URL argument etc) to switch into the
> ascii-encoded binary mode? Which would also behave like to PG and Mysql...

No. I suggest to use a PreparedStatement.

By the way, what almost works is: X'31393836'. At least it seems to be
supported by MySQL, and partially PostgreSQL (but it's a bit array
there, and I didn't find a way to map a bit array to byte array).

Regards,
Thomas

-- 
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