Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> "Ref cursor is invalid" error on JDBC getObject(): Help?!?
I've got a short stored function that returns a ref cursor. This seems
to work fine in PL/SQL:
CREATE or replace package workflow_query
is
type entity_cursor is ref cursor return active_workflow_queue%ROWTYPE;
function find_entities_in_workflow(v_entity_name VARCHAR, v_user_id NUMBER) return entity_cursor;
END workflow_query;
/
CREATE or replace package body workflow_query
as
function find_entities_in_workflow (
v_entity_name VARCHAR, v_user_id NUMBER ) return entity_cursor IS v_entities entity_cursor;
However, when I try to use the function in JDBC, I'm getting peculiar error: "Ref cursor is invalid." The error occurs as soon as I try to use getObject() to get the cursor. The JDBC is pretty simple:
statement = connection.prepareCall("{? = call workflow_query.find_entities_in_workflow(?,?)}"); statement.registerOutParameter(1, Types.OTHER); statement.setString(2, query.getEntityName()); statement.setInt(3, query.getAuthorID().intValue()); statement.execute(); println("getObject(1) returns: " + statement.getObject(1));
It blows up on the last line. If anyone has a clue what's going on (or why the cursor is invalid) I'd really appreciate hearing your thoughts. Thanks!
--- guru_at_creativesun.com Z. J. BeckmanReceived on Fri Jan 25 2002 - 13:39:05 CST
![]() |
![]() |