Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I use SQLJ to return PL/SQL arrays from stored procedures?

0
Posted

Can I use SQLJ to return PL/SQL arrays from stored procedures?

0

Although SQL VARRAYs have been supported by SQLJ and JDBC, PL/SQL index tables are not supported by SQLJ or by JDBC at this time. You would have to use a PL/SQL stored procedure wrapper to convert a PL/SQL index table to of from a VARRAY or nested table to access the argument from Java. For example, if you are trying to call procedure proc01, defined as follows: package pack01 is type rec01 is record(n1 number, d1 date); procedure proc01 (r rec01); … end; you can create a wrapper method as follows: package pack01_wrapper is procedure proc01_wrapper (n1 number, d1 date); … end; package body pack01_wrapper is procedure proc01_wrapper (n1 number, d1 date) is r pack01.rec01; begin r.n1 := n1; r.d1 := d1; pack01.proc01; end; … end; With Oracle 8i, new object types and new collection types (VARRAYs and nested tables) are available in JDBC. Thus, your wrapper package could use an object type with the same attributes as the record, rather than “exploding” the record into individual compo

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.