Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Closing FOR LOOP Cursor ?

551557Jun 14 2007 — edited Jun 14 2007
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2007
Added on Jun 14 2007
3 comments
302 views