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

Home -> Community -> Usenet -> c.d.o.server -> REPOST: "Ref cursor is invalid" error on JDBC getObject(): Help?!?

REPOST: "Ref cursor is invalid" error on JDBC getObject(): Help?!?

From: Zacharias J. Beckman <guru_at_creativesun.com>
Date: Fri, 25 Jan 2002 11:39:05 -0800
Message-ID: <6$--$%%%%--$_--$_$@news.noc.cabal.int>


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;

BEGIN
    OPEN v_entities FOR select id from active_workflow_queue;     return v_entities;
END; END workflow_query;
/

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. Beckman

========= WAS CANCELLED BY =======:
From: "Zacharias J. Beckman" <guru_at_creativesun.com>
Control: cancel <20020125.113848.243268139.639_at_creativesun.com>
Subject: cmsg cancel <20020125.113848.243268139.639_at_creativesun.com>
Date: Mon, 28 Jan 2002 00:19:29 GMT
Message-ID: <cancel.20020125.113848.243268139.639_at_creativesun.com>
X-No-Archive: yes
Newsgroups: microsoft.test,alt.flame.niggers,comp.databases.oracle.server
NNTP-Posting-Host: w088.z064003087.lax-ca.dsl.cnc.net 64.3.87.88
Lines: 1         
Path: news.uni-stuttgart.de!cert.uni-stuttgart.de!news.belwue.de!news-stu1.dfn.de!news-koe1.dfn.de!news-fra1.dfn.de!newsfeed.hanau.net!fr.clara.net!heighliner.fr.clara.net!news.stealth.net!msrtrans1!msrnewsc1!cppssbbsa01.microsoft.com!tkmsftngp01!tkmsftngp04!u&n&a&c&anceller
Xref: news.uni-stuttgart.de control:40722184

This message was cancelled from within The Unacanceller's glorious new software, Lotus 1-2-3 For Rogue Cancellers.
Received on Fri Jan 25 2002 - 13:39:05 CST

Original text of this message

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