8 Haziran 2022 Çarşamba

PL/SQL Exception Hata Kontrollu Çalışmaya Devam Etme / PL/SQL Continue exection after error handled

PL/SQL Continue exception after error handled PL/SQL Exception hata yakalama kontrolü ile programın çalışmasına devam etmeyi sağlama
 DECLARE
        extension_already_exists  EXCEPTION;
        PRAGMA EXCEPTION_INIT(extension_already_exists, -20007);
        l_hidden_col_name  varchar2(32);
    BEGIN
        FOR t IN (  SELECT table_name, cast(extension as varchar2(200)) ext
                    FROM all_stat_extensions
                    WHERE owner='{{ prev_schema }}'
                      and droppable='YES'
                    ORDER BY 1
                 )
        LOOP
            BEGIN
                l_hidden_col_name := dbms_stats.create_extended_stats('{{ schema }}', t.table_name, t.ext);
            EXCEPTION
                WHEN extension_already_exists THEN NULL;   -- ignore exception and go to next loop iteration
            END;
        END LOOP;
    END;
Share:

0 yorum:

Yorum Gönder

Blog Arşivi