Skip to content
January 13, 2017 / doganay

EXCEPTION USAGE IN LOOPS

BEGIN
    FOR i IN (...)
    LOOP
        --BEGIN needed
        BEGIN
            --Do your work here..
        EXCEPTION
            WHEN OTHERS
            THEN
                DBMS_OUTPUT.put_line (i.col1);
                DBMS_OUTPUT.put_line ('SQLCODE: ' || SQLCODE);
                DBMS_OUTPUT.put_line ('SQLERRM: ' || SQLERRM);
        --END needed
        END;
    END LOOP;
END;
/
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: