Hi,

Indeed, we currently do not support MySQL procedures that return cursors,
because (to our knowledge), MySQL's INFORMATION_SCHEMA does not provide any
such information to the code generator. We may be wrong about that, of
course, in case of which we would be more than happy to add this kind of
support to jOOQ...

What you can do, of course, is:

- Base your source code generation on H2 instead of MySQL (I personally
wouldn't recommend that, though - the databases are too different...)
- Implement your own MySQLDatabase in jOOQ-Meta, that provides / patches
the relevant procedures with cursor results

Cheers,
Lukas


2014-06-25 21:03 GMT+02:00 <[email protected]>:

> We use MySQL for production and H2 for unit testing. There are several
> stored procedures that return result sets for data consumptions. We would
> like to use jOOQ to help map the procedure calls to actual java code and
> POJOs.
>
> I have seen information in this group in regards to trying to return
> result sets from stored procs, and they mostly state that you can't do it
> except when using Oracle. Any insight would be helpful on how do do this
> with the use of a simple fetchMany("call myProc(?)"). We would really like
> to use the code generation tool to create concrete java code.
>
> Example MySQL procedure:
>
> DELIMITER $$
> DROP PROCEDURE IF EXISTS getUsers; $$
> CREATE DEFINER=`company`@`%` PROCEDURE `getUsers`(accountName VARCHAR(255))
> BEGIN
>
> SELECT a.id
> FROM tblUsers a
> JOIN tblAccounts b
> ON b.id = a.accountId
> WHERE b.name = accountName;
>
> END$$
> DELIMITER ;
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to