Hello Noel

> Hmm, still not quite understanding what you want to do.

I'm trying to find a very generic way of dealing with the situation I
described. I'm doing this, because I'm developing jOOQ (www.jooq.org),
a product similar to JaQu. I keep running into corner-case situations
of bind values with unknown type like this one with

- DB2, Derby (very often)
- HSQLDB, H2 (some times)
- Ingres, Sybase SQL Anywhere (very rarely)

I have never encountered a similar problem with

- MySQL, Oracle, Postgres, SQLite, SQL Server, Sybase ASE

That's why I was playing around with H2's data type "OTHER". As I
said, casting to "OTHER" might not be the most appropriate solution.
I'll find a way, don't worry. This user group thread here was intended
to indicate and discuss the glitch I observed when serialising /
deserialising "10" as "OTHER", which I don't think is correct

> If you don't know the type of the bind value, you should just use setObject().
> H2 has a lot of internal convert logic to handle converting it to the
> correct type.

You're correct when it comes to simple queries, like "select ?". Since
I'm looking for a stable, generic solution though, I'm afraid I always
have to cast to some type. e.g. as for this query "(select ? \"y\"
from dual) union (select ? \"y\" from dual)"

For your reference, other corner-cases I have previously reported were
these ones:
http://code.google.com/p/h2database/issues/detail?id=329
http://code.google.com/p/h2database/issues/detail?id=330
http://code.google.com/p/h2database/issues/detail?id=331

Regards,
Lukas

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