Hi all,
I have a function as follows:
FUNCTION is_Valid_Segments(cm_no varchar2, pm varchar2)
RETURN BOOLEAN
IS
CURSOR seg_cursor IS
SELECT product_manager,sales_in_segments
FROM temp_product_details
WHERE cm_ticket_no=cm_no;
BEGIN
FOR seg_rec IN seg_cursor
LOOP
IF (TRIM(seg_rec.sales_in_segment) = TRIM(pm)) THEN
RETURN TRUE;
END IF;
END LOOP;
RETURN FALSE;
END;
In the above code i return in between the loop if the condition is satisfied. So does this leave the Cursor open and occupy memory ?
If so how can i close the cursor before the return statement?