| Author |
Calling Remote DB Stored Procedure which returns Ref Cursor
|
BabuRajendraPrasad Tavva
Greenhorn
Joined: Jun 30, 2009
Posts: 6
|
|
Hi Friends,
Good Afternoon.
I have a problem related to accessing a remoted database stored procedure which returns cursor. I am accessing stored procedures from my local DB which returns ref cursor. There is no problem with local DB procedures and I am able to read the data from cursor.
But In case of remote DB, I am not able to read the data. I am able to make a call to remote DB stored procedure. The return value is also valid and able to type cast to ResultSet type. I checked the ResultSetMetaData also on type casted ResultSet object. The column names from ResultSetMetaData object are correct.
The major problem is when I try to read the data from ResultSet. I am getting the Exception, "java.sql.SQLException: ORA-24338: statement handle not executed".
The stack trace of that Exception is as follows.
java.sql.SQLException: ORA-24338: statement handle not executed
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.fetch(T4CStatement.java:1029)
at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:291)
at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:213)
Please note that the same stored procedure is created in local DB also. When I execute this, I am able to read the Data from ResultSet.
When I go through the concept of ref cursors in PL/SQL documentation, I read some where that the memory reference is given/returned in case of ref cursor.
Is my current problem is because of remote DB or something else? I could not locate the actual issue.
Please somebody look into this and give some suggessions. Awaiting for your valuable suggessions.
Thanks in advance.
Best Regards,
Rajendra
|
 |
 |
|
|
subject: Calling Remote DB Stored Procedure which returns Ref Cursor
|
|
|