MySQL Forums
Forum List  »  Stored Procedures

How can I return multiple rows in a stored procedure with Connector/J
Posted by: Ernesto Uribe
Date: March 31, 2005 04:09PM

I m working with callable statetment in JAVA to make a coonection and make sentences SQL, but i have a problem, i dont know how return multiple rows in a stored procedure.

Procedure:
------------

DROP PROCEDURE IF EXISTS demop;
CREATE PROCEDURE demop(OUT salida VARCHAR(50))
BEGIN
DECLARE final INT DEFAULT 0;
DECLARE c1 CURSOR FOR SELECT t_apellidos FROM usuariop ORDER BY t_apellidos DESC;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET final = 1;
OPEN c1;
REPEAT
FETCH c1 INTO salida;
UNTIL final END REPEAT;
CLOSE c1;
END;

Any help ???

Thanks regards.

Options: ReplyQuote


Subject
Views
Written By
Posted
How can I return multiple rows in a stored procedure with Connector/J
15079
March 31, 2005 04:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.