create or replace PACKAGE My_Pkg IS
-- just my specific type
TYPE Varchar2_List IS TABLE OF Varchar2(4000);
-- trying to use my type and Dbms_Sql.Varchar2_Table
procedure does_something(p_ora_list Dbms_Sql.Varchar2_Table, p_my_list Varchar2_List);
END My_Pkg ;
public class MyPkg extends PackageImpl {
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled.
* Deprecation can be turned off using <deprecationOnUnknownTypes/> in your code generator configuration.
*/
@java.lang.Deprecated
public static void does_something(Configuration configuration, Object pOraList, Object pMyList) {
// ...
}
}
Hi,I'm using Oracle 11g XE and I have this specific package:
create or replace PACKAGE My_Pkg IS
-- just my specific type
TYPE Varchar2_List IS TABLE OF Varchar2(4000);
-- trying to use my type and Dbms_Sql.Varchar2_Table
procedure does_something(p_ora_list Dbms_Sql.Varchar2_Table, p_my_list Varchar2_List);
END My_Pkg ;Notice my package has 2 associative array types: one for Oracle Dbms_Sql.Varchar2_table and the other one for my custom type (Varchar2_List).So when I try to generate code via jOOQ generator (v3.10.6) I'm getting this class:
public class MyPkg extends PackageImpl {
/**
* @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled.
* Deprecation can be turned off using <deprecationOnUnknownTypes/> in your code generator configuration.
*/
@java.lang.Deprecated
public static void does_something(Configuration configuration, Object pOraList, Object pMyList) {
// ...
}
}It seems like jOOQ doesn't know both types, so it's considering them as Unknown data types.
As far as I know jOOQ supports associative arrays for default SQL types (Number, Varchar2 etc) and custom SQL types (create type "Product" as Object (...)).
create or replace type Varchar2_List is table of varchar2(4000);
Hi Lukas,Thanks again for all the explanation.I thought jOOQ didn't support associative arrays and PLSQL tables only for Record Types (aka PLSQL Types) but as you said it doesn't support them for any PLSQL Type at all. At least that's what I understood now.
I also thought DBMS_SQL.Varchar2_Table was an Object Type (aka SQL Type) but it isn't. That's why jOOQ doesn't support it in Oracle 11g (and yes, you're right, I misunderstood that because your post).
So to solve my issue I had to create my custom SQL Type:
create or replace type Varchar2_List is table of varchar2(4000);
Now jOOQ is able to generate my classes without problems!
Although I try to favor PLSQL Types over SQL ones as much as I can, unfortunately we still use Oracle 11g here and I have to deal with its limitations related to JDBC driver. For my sake, I'm learning some ways to work with jOOQ in my not so good reality.
--
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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Interesting to know Oracle is investing some effort in improving JDBC driver to make developer's life easier. Not supporting boolean and other types is very annoying and bothers me too much.
As far as I know Oracle 12c doesn't serialize Record Types but converts them to temporary Object types. If I'm not wrong I think I read this in the own 12c documentation. Or are you talking about another thing?
All PL/SQL package types are mapped to a system-wide unique name that can be used by JDBC to retrieve the server-side type metadata. The name is in the following form:
[SCHEMA.]<PACKAGE>.<TYPE>
declare
l_p jOOQ.Product_t;
l_cursor Sys_refcursor;
begin
-- converts array of record types to sys_refcursor
open l_cursor for
select pf.*
from table(jOOQ.pipelined_function) pf; -- this function returns an array of Product_t
-- iterates over cursor
loop
fetch l_cursor into l_p;
exit when l_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('code=' || l_p.code);
DBMS_OUTPUT.PUT_LINE('name=' || l_p.name);
end loop;
close l_cursor;
end;
--
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 jooq-user+unsubscribe@googlegroups.com.
Lukas
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.