| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> bulking with PLSQL/Java params passing & collections puzzle.. tough one!
Hello all,
test platforms: Oracle Enterprise Edition 9.2.0.2 W2K & Solaris SPARC 64.
I need to execute a Java Procedure method that generate a collection of double coefficients out of two input collection parameters (collections are of table type):
create type dateArray as table of DATE;
create type doubleArray as table of NUMBER;
create or replace function kdpae_computecoeffs(times in dateArray
,
tvalues in doubleArray) return doubleArray
AUTHID CURRENT_USE
,
tvalues in doubleArray
,
tcoeffs in out nocopy doubleArray) return String
AUTHID CURRENT_USE
--//
--// Anonymous PL/SQL example
--//
declare
type table_doubleArray is table of doubleArray;
type table_dateArray is table of dateArray;
type nums_list is table of number(9);
times dateArray := dateArray();
tvalues doubleArray := doubleArray();
ntimes table_dateArray := table_dateArray(); ntvalues table_doubleArray := table_doubleArray(); ntcoeffs table_doubleArray := table_doubleArray(); j number(9); dummyStr varchar2(100); indxs nums_list := nums_list();
begin
--// compute aggregations...
--// collect input data into ntimes and ntvalues...
execute immediate 'ALTER SESSION FORCE PARALLEL QUERY'; execute immediate 'ALTER SESSION FORCE PARALLEL DML';
end;
/
I can only end up with a total failing solution that doesn't allow Oracle work in parallel and hence this does not scale on multi-processor enviroments:
for i in ntimes.first .. ntimes.last
loop
ntcoeffs(i) := doubleArray(); // initialize... is it required?
select kdpae_computecoeffs(ntimes(i), tvalues(i))
into ntcoeffs(i)
from dual;
I also tried this piece:
assume all type definitions are moved into varray something like this:
create or replace type doubleArray190 as varray(190) of NUMBER;
create table coefficients_table (
coefficients doubleArray190
) PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
/
I didn't find how to create a column of type table but only a column of fixed size varray.
forall i in ntimes.first .. ntimes.last
insert into coefficients_table
select kdpae_computecoeffs(ntimes(i), tvalues(i))
from dual;
but I checked this statement did not work in parallel either in a Solaris
SPARC
8 processors, perhaps because of varray columns???
Any help greatly appreciated,
Best regards,
Giovanni
Received on Mon Mar 24 2003 - 06:15:17 CST
![]() |
![]() |