This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes REF_CURSOR as IN parameter? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "REF_CURSOR as IN parameter?" Watch "REF_CURSOR as IN parameter?" New topic

REF_CURSOR as IN parameter?

Manuj Bawa

Joined: Dec 13, 2004
Posts: 7

I have a stored procedure in Oracle which takes an input as a REF_CURSOR. What I am intending to to from java is pass an Array of Objects which has the 2 values in each object the stored procedure is trying to break and insert.

Till now I have not been able to find the correct datatype to send to this procedure, I have'nt even got into Custom Data Types with Oracle.

Can any one please tell me if there is a data type which would let me send multiple records to be inserted through the following stored procedure:

PROCEDURE sp_test_rvf(Param1 IN r_cursor)IS
id_1 INTEGER := 0;
id_2 INTEGER := 0;
FETCH Param1 INTO id_1, id_2;
INSERT INTO corr_batch_job(corr_batch_job_sid, corr_temp_sid)
VALUES(id_1, id_2);

It is sorta covered in the JavaRanch Style Guide.
subject: REF_CURSOR as IN parameter?
Similar Threads
getting the resultset of a stored procedure?
Passing an integer array to a Oracle Stored Procedure
how to insert multiple value in database
CallableStatement Error on Oracle Stored Procedure.
Problem using Callable Statement