I have the following types:
create or replace TYPE mytimestamp AS VARRAY(300) OF TIMESTAMP(6);
create or replace TYPE trade_history_dts_array AS VARRAY(300) OF mytimestamp;
The types are used in this way in the stored procedure:
trade_history_dts tradehistorydtsarray ;
FOR i IN 1..20
loop
trade_history_dts(i) := mytimestamp();
LOOP
trade_history_dts(i).extend();
FETCH trade_history_cursor INTO
trade_history_dts(i)(j),
dbms_output.put_line(trade_history_dts(i)(j));
j := j+1;
exit when trade_history_cursor%notfound;
END LOOP;
j:=1;
end loop;
The stored procedure is tested, and I can get the right the result:
information for trade 1
trade_history_dts(1)(1)17-OCT-05 03.49.57.000000 PM
trade_history_dts(1)(2)17-OCT-05 03.49.58.000000 PM
information for trade 2
trade_history_dts(2)(1)27-JUN-05 09.02.59.000000 AM
trade_history_dts(2)(2)27-JUN-05 09.02.59.000000 AM
trade_history_dts(2)(3)27-JUN-05 09.03.01.000000 AM
information for trade 3
trade_history_dts(3)(1)09-FEB-06 09.31.03.000000 AM
trade_history_dts(3)(2)09-FEB-06 09.31.05.000000 AM
....
Now I want to get the this result in java, and transform it to a 2-dimensional array.
I tried the following:
Timestamp[][] trade_history_dts = (Timestamp[][])trade_history_dts_arr.getArray();
but it does not work. Does anybody know how to transform it to a 2-dimensional array in java? Thank you!