Hello, Thanks for reporting. Returning single table records from user-defined functions is currently not supported by jOOQ. I have registered an issue for this: https://github.com/jOOQ/jOOQ/issues/3942
Best Regards, Lukas 2015-01-13 16:11 GMT+01:00 <[email protected]>: > Here are more data, about another test: > > DB part: > test=> \d simpletable > Table "public.simpletable" > ┌────────┬─────────┬───────────┐ > │ Column │ Type │ Modifiers │ > ├────────┼─────────┼───────────┤ > │ a │ integer │ │ > └────────┴─────────┴───────────┘ > > test=> \sf testsub2 > CREATE OR REPLACE FUNCTION public.testsub2(OUT r simpletable) > RETURNS simpletable > LANGUAGE plpgsql > AS $function$ > begin > select * from simpletable into r limit 1; > end; > $function$ > > > > > Java part: > > Testsub2 t2 = new Testsub2(); > t2.execute(create.configuration()); > System.out.println("GOT 2 : " + t2.getR()); > > > > Got exception: > > org.jooq.exception.DataAccessException: SQL [{ call "public"."testsub2"(?) > }]; A CallableStatement function was executed and the out parameter 1 was > of type java.sql.Types=4 however type java.sql.Types=1111 was registered. > at org.jooq.impl.Utils.translate(Utils.java:1553) > at > org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:571) > at > org.jooq.impl.AbstractRoutine.executeCallableStatement(AbstractRoutine.java:368) > at org.jooq.impl.AbstractRoutine.execute(AbstractRoutine.java:270) > at org.jooq.impl.AbstractRoutine.execute(AbstractRoutine.java:256) > at test.Test.main(Test.java:43) > Caused by: org.postgresql.util.PSQLException: A CallableStatement function > was executed and the out parameter 1 was of type java.sql.Types=4 however > type java.sql.Types=1111 was registered. > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:468) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:410) > at > org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:194) > at org.jooq.impl.AbstractRoutine.execute0(AbstractRoutine.java:381) > at > org.jooq.impl.AbstractRoutine.executeCallableStatement(AbstractRoutine.java:342) > ... 3 more > > -- > 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.
