Calling Remote DB Stored Procedure which returns Ref Cursor
posted 5 years ago
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
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.