语法:
declare continue handler for sqlstate '错误代码值' set 变量=变量值
如:
create procedure p_insertDome()
begin
declare continue handler for sqldate '42S02' set @x=1;
insert into userinfo2(uid,name,password)values('1','demo','123456');
insert into employ('empno','date')values('2220','1993-12-14');
end;
$$;假如第一个语句出现数据表不存在,就不会影响下一行语句执行
以上就是MySQL高级四——自定义条件和处理的内容,更多相关内容请关注PHP中文网(www.php.cn)!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号