Espen,
I have seen that your H2 stored function implementation skips code generation for H2's stored functions returning void. I am now tackling
https://sourceforge.net/apps/trac/jooq/ticket/170, and I can see that I will run into a similar thing with Postgres. Personally, I think of functions without return value to actually be like procedures and I would like to map them as such, even if the term "procedure" does not exist in the underlying RDBMS.
I guess that's a matter of taste. As I am mainly an "Oracle guy", I prefer this convention. What do you think? I created
https://sourceforge.net/apps/trac/jooq/ticket/193 for the H2 database.
In the mean time, I have googled the support for returning result sets a bit more. This is going to be a really tricky one to map. I found the following data types to be valid return types for stored procedures / functions. All of them are currently missing in jOOQ:
- ARRAY (that's a JDBC standard https://sourceforge.net/apps/trac/jooq/ticket/163)
- ResultSet (that's not a JDBC standard), such as cursors in Oracle, JDBC ResultSet in H2, Postgres has something similar as well
- Tables (not a JDBC standard either), various implementations for this. Functions returning tables can be used in FROM clauses... That will be interesting
The ResultSet seems to be the most difficult one to standardise.
Cheers
Lukas