Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Reading nested oracle cursors on Java: getCursor(col) throws ORA-01002 "Fetch out of sequence"

Reading nested oracle cursors on Java: getCursor(col) throws ORA-01002 "Fetch out of sequence"

From: Alain Coetmeur <alain.coetmeur_at_caissedesdepots.fr>
Date: 7 Jun 2002 09:32:23 -0700
Message-ID: <fb378520.0206070832.21542e4d@posting.google.com>


On oracle 9i (and from java JDK1.4)
I'm trying to read the nested cursors that are returned by a request, (using "cursor" keyword or PL/SQL function which returns cursors).

however, when I try to "getCursor" or "getObject" the cursor column, I get the "ORA-01002: fetch out of sequence" SQL exception.  

metaInfo show the types are good...

How can one safely read the content of NESTED cursors?

ps: my methods works perfectly with simple cursors returned by stored functions or procedures.

--
The request looks like
like:
select 
T.*, cursor(select * from U where U.owner=T.id) 
from T

or through PL/SQL function returning cursor like:
select 
T.*, PACKAGE1.getUByOwner from T

I create the usual Statement,
get the ResultSet,
call
resultSet.next();
and it fails on

((OracleResultSet) resultSet).getCursor(col);

autocommit is false (same with true).

the columns is
of SQL type name "REFCURSOR" according to the ResultSetMetaData,
and metaInfo.getColumnType(col) == oracle.jdbc.OracleTypes.CURSOR
Received on Fri Jun 07 2002 - 11:32:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US