Thursday, April 26, 2012

Continue Statement

Finally continue statement added to oracle 11g PL/SQL language. It signals an immediate end to a loop iteration and return to first statement of in the loop.
e.g. Addition of odd numbers.
DECLARE
    total BINARY_INTEGER := 0;
BEGIN
    FOR i in 1..10 LOOP
        IF MOD(i/2) = 0 THEN
          CONTINUE;
        END IF;
        SUM = SUM + i;
    END LOOP,
    DBMS_OUTPUT.PUT_LINE('Sum of odd numbers is '|| sum );
END;
/

No comments:

Post a Comment

External Table

Oracle External Table External tables are defined as tables that do not resides in the database allows you to access data that is stor...