Hi,
> I have an application that creates insert queries on tables with blob
> fields, originally designed to work with mysql.
> MySQL allows such queries to have for example the form
>
> insert into mytable (blobfield) values ('a value')
> I found that H2 only allows hexidecimal strings on such queries when
> it comes to blobs (and other binary fields).
If VARCHAR is converted to BINARY automatically, it is parsed as a
hex. In H2, if you want to convert text to a binary using the UTF-8
encoding, you could use STRINGTOUTF8:
http://www.h2database.com/html/functions.html#stringtoutf8 . This will
generate one byte for each ASCII character (character codes 0 - 127).
> Is it possible to change this behavior, if needed by modifying the H2
> source code? And if so, where should I look?
For compatibility with other databases, I suggest to change your
application to pass binary data, for example using a
PreparedStatement.
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
-~----------~----~----~----~------~----~------~--~---