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!

pragma exception_init(g_dml_errors, -24381);

Tricampeon_1981Dec 12 2019 — edited Dec 12 2019

Hello friends how are you??

You know I have a procedure that I am reviewing and is quite accessible, I just don't understand this line for what this is, I know it is to camp the error but the second line I don't understand

CREATE OR REPLACE procedure CTRB_CGA_GEN IS

g_dml_errors exception;

pragma exception_init(g_dml_errors, -24381);

begin

select count(1) from cliente;

EXCEPTION

           WHEN NO_DATA_FOUND THEN

                v_des_err := SQLERRM;

                v_est_cga := 'E';

           WHEN g_dml_errors THEN

                  g_errorCnt := SQL%BULK_EXCEPTIONS.COUNT;

                  v_des_err := SQLERRM;

                  v_est_cga := 'E';

                      IF SQL%BULK_EXCEPTIONS(g_errorCnt).ERROR_CODE = 1

                      THEN

                        v_des_err := SQLERRM;

                        v_est_cga := 'E';

                      END IF;

           WHEN OTHERS THEN

END CTRB_CGA_GEN;

This post has been answered by jaramill on Dec 12 2019
Jump to Answer
Comments
Post Details
Added on Dec 12 2019
8 comments
505 views