Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Self destruct mode activated. Instructions for deactivation encoded in this tiny ad.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic