暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

mysql创建 handler报错

WaHotDog学习笔记 2021-11-17
354

Cursor declaration after handler declaration

意思就是 handler必须在申明的游标后面

创建游标

declare stu_cursor cursor for
select g.user_id,s.`name`,g.grades from student_info s,grades g where s.id=g.user_id;

处理游标

declare continue handler for 1329 set v_flag=false;

handler 语法结构

DECLARE handler_action HANDLER
FOR condition_value [, condition_value] ...
statement

handler_action:
CONTINUE
| EXIT

condition_value:
mysql_error_code
| SQLSTATE [VALUE] sqlstate_value
| condition_name
| SQLWARNING
| NOT FOUND
| SQLEXCEPTION


文章转载自WaHotDog学习笔记,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论