Friday, November 09, 2007

ORA-24338: statement handle not executed

This happens when you try to read a cursor after fetching data from it. Try to read the cursor before you fetch data from it

PROCEDURE GetAffiliateCouriers(paffiliate_id number, io_cursor IN OUT appCursor)
IS
vcursor appCursor; tcursor appCursor; retCursor appCursor;
affiliate_id INTEGER; t_allow_courier_selection INTEGER;
v_row AFFILIATE%ROWTYPE; t_row AFFILIATE_COURIER%ROWTYPE;
BEGIN
vcursor := NULL;
tcursor := NULL;
affiliate_id := paffiliate_id;
LOOP
OPEN vcursor FOR SELECT * FROM affiliate WHERE id = affiliate_id AND allowcourierselection = 1;
FETCH vcursor INTO v_row;
IF (vcursor%FOUND) THEN
OPEN tcursor FOR SELECT * FROM affiliate_courier WHERE affiliate_courier.fk_affiliate_id = affiliate_id;
FETCH tcursor INTO t_row;
IF (tcursor%FOUND) THEN
OPEN retCursor FOR SELECT * FROM affiliate_courier WHERE affiliate_courier.fk_affiliate_id = affiliate_id;
io_cursor := retCursor;
RETURN;
END IF;
END IF;
SELECT fk_parent_id INTO affiliate_id FROM affiliate WHERE affiliate.id = affiliate_id;
EXIT WHEN affiliate_id IS NULL;
END LOOP;
io_cursor := retCursor;
END GetAffiliateCouriers;

No comments:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...