重要的几个
1049 数据库不存在1051 数据表不存在1054 字段不存在
##字符串类型的错误码SQLSTATE sqlstate_value##数值类型的错误码mysql_error_code
DECLARE condition_name CONDITION FOR [condition_type]
DECLARE handler_type HANDLER FOR condition_value [...]
handler_type 产生异常做什么操作
continue 跳过异常继续执行
exit 退出
condition_value 异常条件类型
create PROCEDURE show_user(out code_num int)BEGIN DELCARE no_table condition for 1054; DECLARE CONTINUE HANDLER FOR no table; set code_num=1; select user1 from login;end;call show_user(@aa) ;select @aa;
联系客服