File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Reading nested oracle cursors getCursor(col) throws ORA-01002 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Reading nested oracle cursors getCursor(col) throws ORA-01002 "Fetch out of sequence"" Watch "Reading nested oracle cursors getCursor(col) throws ORA-01002 "Fetch out of sequence"" New topic
Author

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

Alain Coetmeur
Greenhorn

Joined: Jun 07, 2002
Posts: 1
On oracle 9i
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...
autocommit is false (same with true).
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);

the columns is
of SQL type name "REFCURSOR" according to the ResultSetMetaData,
and metaInfo.getColumnType(col) == oracle.jdbc.OracleTypes.CURSOR
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Reading nested oracle cursors getCursor(col) throws ORA-01002 "Fetch out of sequence"
 
Similar Threads
ora-01002 "Fetch out of Sequence"
ORA-01002 fetch out of sequence
What am i doing wrong here? ( Stored Procedure REF CURSOR Problem)
ora-01002 fetch out of sequence
ORA-01002:fetch out of sequence