Hello,

I'm making some heavy use of queries with "in (1, 2, 3...)" clauses
with a *highly* variable amount of values in the parenthesis.
Using prepared statements would speed things up a lot, but I need
something like :

"select m.* from myTable where myCol in (??)"

... which does not seem to be supported by H2 (as opposed to "in
(?)").
Of course, preparing gradually complex statements "in (?)", "in
(?, ?)", "in (?, ?, ...)" is not an option I like :-)

I saw at the end of this thread that this is possible on Oracle :
http://forums.sun.com/thread.jspa?threadID=504838

-> SELECT FROM MYTABLE WHERE ID_FIELD IN (SELECT FROM TABLE (?))
and
-> SELECT M. FROM MYTABLE M, TABLE(?) T WHERE M.ID_FIELD =
T.COLUMN_VALUE

The oracle driver then requires an oracle.sql.ARRAY for the prepared
statement's parameter, but I guess Object[] would be nicer in H2 :-)

Am I missing some H2-specific feature or workaround ?
If not, do you think it's reasonable to consider including this to the
roadmap ? (with syntax "TABLE(?)", "in (??)" or "in (?...)" for
instance)

Many many thanks for this excellent DB, btw !

Cheers
--
Olivier

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