The INSERT error transfers control to the exit handler for that SQLSTATE code.
INSERT 错误将控制转移到 SQLSTATE 代码的退出处理程序。
When the INSERT statement fails with the error code specified in the DECLARE exit handler statement, control passes to the handler, and the procedure is exited.
当insert语句失败并且错误代码在DECLARE EXIT handler语句中指定,那么控制将传递到处理程序,而过程将退出。
So in the example above, the NOT NULL constraint would get violated, and the INSERT statement would error out.
因此,在上面的示例中,会违反 NOT NULL 约束,INSERT 语句会出错。
应用推荐