Hi, Unfortunately, H2 does not support the syntax SELECT * FROM TABLE(GET_NUMBERS()).
Regards, Thomas On Friday, April 27, 2012, Łukasz Drumiński wrote: > Loic, thanks for answer. My situation is that: I use on production Oracle > database. Now, I'm trying to use H2 in integration tests. In application on > production I use exacly this query: SELECT * FROM TABLE(GET_NUMBERS()) and > its not good idea to change it. So I'am asking, is there any way to handle > exacly this query in H2? Your sugestions are ok but they will work only in > H2 and this is not solution for my problem. > LD > 27-04-2012 17:24, "Loic Petit" <[email protected] <javascript:_e({}, > 'cvml', '[email protected]');>> napisał(a): > >> Hi, >> >> You could do the following prepared statement : >> SELECT * FROM TABLE(ID NUMBER=?) >> then you can set the parameter with a setObject(1,new Object[] >> {1,2,3,4,5,6,7,8,9,10}) >> >> If you really want to do an external java function (though I do not >> understand why), I suppose you could write >> SELECT * FROM TABLE(ID NUMBER=GET_NUMBERS()) >> ...and the function must return an array. But I'm not sure if it is >> possible to do that. >> >> LP >> >> >> 2012/4/27 Łukasz Drumiński <[email protected] <javascript:_e({}, >> 'cvml', '[email protected]');>> >> >>> Hello, >>> >>> this is working fine: >>> >>> SELECT * FROM TABLE(ID NUMBER=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) >>> >>> but I need to do something like this: >>> >>> SELECT * FROM TABLE(GET_NUMBERS()) >>> >>> is this posible? >>> >>> I could create alias GET_NUMBERS for some Java method but I don't know >>> how this method should look. I will be grateful for any help. >>> >>> 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]<javascript:_e({}, 'cvml', >>> '[email protected]');> >>> . >>> To unsubscribe from this group, send email to >>> [email protected] <javascript:_e({}, 'cvml', >>> 'h2-database%[email protected]');>. >>> For more options, visit this group at >>> http://groups.google.com/group/h2-database?hl=en. >>> >>> >> -- >> 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]<javascript:_e({}, 'cvml', >> '[email protected]');> >> . >> To unsubscribe from this group, send email to >> [email protected] <javascript:_e({}, 'cvml', >> 'h2-database%[email protected]');>. >> For more options, visit this group at >> http://groups.google.com/group/h2-database?hl=en. >> > -- > 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]<javascript:_e({}, 'cvml', > '[email protected]');> > . > To unsubscribe from this group, send email to > [email protected] <javascript:_e({}, 'cvml', > 'h2-database%[email protected]');>. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > -- 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.
