Re: Inserting errors into logs
Minimally...
CREATE PROCEDURE errdemo( pvalue INT, OUT pResult INT )
BEGIN
DECLARE bad_key CONDITION FOR SQLSTATE '23000';
DECLARE EXIT HANDLER FOR bad_key
BEGIN
INSERT INTO errlog
SET dt=Now(),msg=Concat('Insert on t failed; bad key.');
SET presult=-1;
ROLLBACK;
END;
START TRANSACTION;
INSERT INTO t VALUES( pvalue, NULL ) ;
SET pResult=Row_Count();
COMMIT;
END;
END;
Subject
Views
Written By
Posted
761
April 20, 2020 07:10AM
Re: Inserting errors into logs
369
April 20, 2020 11:29AM
389
April 22, 2020 06:58AM
375
April 22, 2020 02:45PM
370
April 23, 2020 12:38AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.