Originally posted by Nimesh Gala:
i am a total newbie to Oracle and JDBC combination.
i have written a stored procedure that is expected to return multiple rows.
but when i execute it i get only the first row of it.
my procedure is
CREATE OR REPLACE Procedure SPGETOFFERSINGROUP
( parentId IN VARCHAR2)
IS
OFFID tbl_Offer_Level_Master.offer_id%type;
DES tbl_Offer_Group_Details.description%type;
BEGIN
SELECT tbl_Offer_Level_Master.offer_id, tbl_Offer_Group_Details.description
INTO OFFID, DES
FROM tbl_Offer_Level_Master, tbl_Offer_Group_Details
WHERE tbl_Offer_Level_Master.parent_id = tbl_Offer_Group_Details.offer_group_id
AND tbl_Offer_Level_Master.parent_id=parentId;
END;
this returns only the first record matching the crieteria,
how will i get all the rows?, do i have to use cursors, if so how?
what code is expected to be written in java to get the multiple records.
Define a cursor to fetch the rows. See the syntax for declaring and opening of the cursor then fetch the rows ome by one from the cursor. See a standard text book on oracle for syntax of declaring, opening and fetching of the cusrsor.
Thanks and Regards,
Gulab Singh
[This message has been edited by Nimesh Gala (edited August 11, 2001).]