Help With Exception Handling

Database

Help With Exception Handling

I am new to teradata.  I have created a Stored Procedure that pulls SQL statments from a table, execute those statementes and places the results in another table.  If any of those SQl statements fail I want the error to be stored in our Log table.  I placed a SQL statement that I know will fail but when I run the procedure I see the Procedure call fais and it give me the error messsage but it is not inserting into the log table. Below is the exception code I am using. Any help is appreciated.

BEGIN

DECLARE EXIT HANDLER FOR SQLEXCEPTION

                BEGIN

                SET V_SQL_Msg = V_SQL_ERR_CD || '    ' || V_SQL_STATE;

 INSERT INTO EMAR_DEV.M_SIT_LOG_TB

 VALUES(PV_USER_NAME, 'M_CLM_SIT_TESTING_TB',PV_TEST_SUITE, 'ALL',to_char(DATE, 'dd-MON-yyyy'), :v_SQL_Msg, :V_SRC_FINAL_SQL, :V_TRG_FINAL_SQL );

END;

END;