drop procedure if exists handlerproc // create procedure handlerproc(OUT p_end VARCHAR(10)) begin declare continue handler for sqlstate '23000' SET @b = 'With SQLSTATE'; declare continue handler for 1062 SET @b = '- With Error 1062'; insert into emps VALUES (1,'Dave',1,10); set p_end := concat('The End',@b); end; //