lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

feature request: output parameters not supported in stored procedures #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the stored procedure support is documented with examples
returning either only a single ResultSet or a primitive type.

Are there any plans to provide support for output parameters, or multiple
ResultSets?

The implementation could be as follows:
- from the static method that is aliased as the stored proc, one could
return a java.util.List, which might have more than 1 ResultSet (typically
H2's SimpleResultSet), as well as objects (a new class can be introduced
into H2 such as SimpleOutputParameter which knows indices etc), and this
list can be used to feed the caller with multiple getResultSet() calls as
well as getObject(int) calls for stored procs.

Original issue reported on code.google.com by celal.zi...@gmail.com on 19 May 2009 at 8:50

GoogleCodeExporter commented 9 years ago
Hi,

Could you explain why you need this feature?

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 21 May 2009 at 4:45

GoogleCodeExporter commented 9 years ago
This is extremely useful when one uses H2 as a mock database for a real one 
during
testing and development.

Basically, you can call your stored proc in H2 instead of Sybase/DB2/Oracle etc
during testing. And stored procedures can return nultiple ResultSet, update 
count or
output parameters according to the jdbc specification. So it would be good to 
have an
implementation that is compliant with jdbc.

Original comment by celal.zi...@gmail.com on 21 May 2009 at 4:53

GoogleCodeExporter commented 9 years ago
I will add this to the roadmap (with a link to this bug)

Original comment by thomas.t...@gmail.com on 29 May 2009 at 4:10

GoogleCodeExporter commented 9 years ago
I would also appreciate this support for the same reason: Testing and 
documenting the new stored procedure API in Java Persistence 2.1. 

(By the way, Derby can't even do ANY stored procedures with the in-memory 
embedded datasource driver, most CallableStatement methods are not implemented. 
So for a typical Java developer who wants to mock/test stored procedure calls 
without booting Oracle, there aren't many options right now.)

Original comment by christia...@gmail.com on 12 May 2013 at 11:44

GoogleCodeExporter commented 9 years ago
I understand. Unfortunately, it's unlikely that I will implement it anytime 
soon, as it is a feature only very very few people are interested in. Patches 
are welcome of course!

Original comment by thomas.t...@gmail.com on 31 May 2013 at 2:44