当前位置: 首页 > news >正文

武汉大墨迹试试网站开发百度关键词排名批量查询

武汉大墨迹试试网站开发,百度关键词排名批量查询,小宽带怎样做视频网站,在建设厅网站上查询注销建造师目录 介绍 案例 通过SQLSTATE指定具体的状态码 通过SQLSTATE的代码简写方式 NOT FOUND 介绍 条件处理程序(Handler)可以用来定义在流程控制结构执行过程中遇到问题时相应的处理步骤。具体语法为: DECLARE handler_action HANDLER FOR c…

目录

介绍

案例

通过SQLSTATE指定具体的状态码

通过SQLSTATE的代码简写方式 NOT FOUND


介绍

条件处理程序(Handler)可以用来定义在流程控制结构执行过程中遇到问题时相应的处理步骤。具体语法为:

DECLARE handler_action HANDLER FOR condition_value [, condition_value]
... statement ;handler_action 的取值:CONTINUE: 继续执行当前程序EXIT: 终止执行当前程序condition_value 的取值:SQLSTATE sqlstate_value: 状态码,如 02000SQLWARNING: 所有以01开头的SQLSTATE代码的简写NOT FOUND: 所有以02开头的SQLSTATE代码的简写SQLEXCEPTION: 所有没有被SQLWARNING 或 NOT FOUND捕获的SQLSTATE代码的简写

通过条件处理程序可以来解决我们上篇中遇到的bug。

案例

我们继续来完成在上篇提出的需求,并解决其中的问题。

根据传入的参数uage,来查询用户表tb_user中,所有的用户年龄小于等于uage的用户姓名
(name)和专业(profession),并将用户的姓名和专业插入到所创建的一张新表
(id,name,profession)中。

  • 通过SQLSTATE指定具体的状态码

-- 逻辑:
-- A. 声明游标, 存储查询结果集
-- B. 准备: 创建表结构
-- C. 开启游标
-- D. 获取游标中的记录
-- E. 插入数据到新表中
-- F. 关闭游标create procedure p(in uage int)
begindeclare uname varchar(100);declare upro varchar(100);declare u_cursor cursor for select name,profession from tb_user where age <= uage;-- 声明条件处理程序 : 当SQL语句执行抛出的状态码为02000时,
-- 将关闭游标u_cursor,并退出declare exit handler for SQLSTATE '02000' close u_cursor;drop table if exists tb_user_pro;create table if not exists tb_user_pro(id int primary key auto_increment,name varchar(100),profession varchar(100));open u_cursor;while true dofetch u_cursor into uname,upro;insert into tb_user_pro values (null, uname, upro);end while;close u_cursor;end;call p(30);
  • 通过SQLSTATE的代码简写方式 NOT FOUND

02 开头的状态码,代码简写为 NOT FOUND

create procedure p(in uage int)
begindeclare uname varchar(100);declare upro varchar(100);declare u_cursor cursor for select name,profession from tb_user where age <= uage;-- 声明条件处理程序 : 当SQL语句执行抛出的状态码为02开头时,
-- 将关闭游标u_cursor,并退出declare exit handler for not found close u_cursor;drop table if exists tb_user_pro;create table if not exists tb_user_pro(id int primary key auto_increment,name varchar(100),profession varchar(100));open u_cursor;while true dofetch u_cursor into uname,upro;insert into tb_user_pro values (null, uname, upro);end while;close u_cursor;end;call p(30);

具体的错误状态码,可以参考官方文档:
https://dev.mysql.com/doc/refman/8.0/en/declare-handler.html
https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html


文章转载自:
http://dinncotowmond.tqpr.cn
http://dinncoio.tqpr.cn
http://dinncomariology.tqpr.cn
http://dinncosurculose.tqpr.cn
http://dinncomaura.tqpr.cn
http://dinncoshin.tqpr.cn
http://dinncoloverboy.tqpr.cn
http://dinncoproteolysis.tqpr.cn
http://dinncogalvanotactic.tqpr.cn
http://dinncobielorussia.tqpr.cn
http://dinncotrounce.tqpr.cn
http://dinncohauberk.tqpr.cn
http://dinncozarathustra.tqpr.cn
http://dinncocropless.tqpr.cn
http://dinncooversleeve.tqpr.cn
http://dinncornzn.tqpr.cn
http://dinncolunk.tqpr.cn
http://dinncodisturbed.tqpr.cn
http://dinncohjs.tqpr.cn
http://dinncoimmunohistology.tqpr.cn
http://dinncoequalise.tqpr.cn
http://dinncozoolith.tqpr.cn
http://dinncobasilect.tqpr.cn
http://dinncocusco.tqpr.cn
http://dinncopulverable.tqpr.cn
http://dinncovint.tqpr.cn
http://dinncoatrous.tqpr.cn
http://dinncocadaster.tqpr.cn
http://dinncoceratin.tqpr.cn
http://dinncoinvestigate.tqpr.cn
http://dinncoabbess.tqpr.cn
http://dinncoacrimonious.tqpr.cn
http://dinncohaemoid.tqpr.cn
http://dinncoperiscopical.tqpr.cn
http://dinncoclwyd.tqpr.cn
http://dinnconitrosylsulphuric.tqpr.cn
http://dinncodichotomy.tqpr.cn
http://dinnconanocurie.tqpr.cn
http://dinncoeffeminate.tqpr.cn
http://dinncocomminatory.tqpr.cn
http://dinncocichlid.tqpr.cn
http://dinncoventure.tqpr.cn
http://dinncoprevenient.tqpr.cn
http://dinncodynasticism.tqpr.cn
http://dinncoberyl.tqpr.cn
http://dinncovfd.tqpr.cn
http://dinncofugle.tqpr.cn
http://dinncorepercussiveness.tqpr.cn
http://dinncolysine.tqpr.cn
http://dinncoquarterback.tqpr.cn
http://dinncounimpassioned.tqpr.cn
http://dinncoblueprint.tqpr.cn
http://dinncovisive.tqpr.cn
http://dinncoinvolved.tqpr.cn
http://dinncodud.tqpr.cn
http://dinncogalatz.tqpr.cn
http://dinncoaltruism.tqpr.cn
http://dinncoachech.tqpr.cn
http://dinncodeter.tqpr.cn
http://dinncoconstringent.tqpr.cn
http://dinncocountryseat.tqpr.cn
http://dinncodauntless.tqpr.cn
http://dinncopanellist.tqpr.cn
http://dinncocornetist.tqpr.cn
http://dinnconsb.tqpr.cn
http://dinncosubjunction.tqpr.cn
http://dinncomorton.tqpr.cn
http://dinncoirremissible.tqpr.cn
http://dinncospiky.tqpr.cn
http://dinncobobcat.tqpr.cn
http://dinnconematocyst.tqpr.cn
http://dinncohiding.tqpr.cn
http://dinncoecad.tqpr.cn
http://dinncocomby.tqpr.cn
http://dinncodownflow.tqpr.cn
http://dinncosurtax.tqpr.cn
http://dinncouncommercial.tqpr.cn
http://dinncohomological.tqpr.cn
http://dinncopolymethylene.tqpr.cn
http://dinncojelly.tqpr.cn
http://dinncodegressive.tqpr.cn
http://dinncobottled.tqpr.cn
http://dinncotholobate.tqpr.cn
http://dinncoelizabeth.tqpr.cn
http://dinnconevermore.tqpr.cn
http://dinncodeparture.tqpr.cn
http://dinncosprue.tqpr.cn
http://dinncorephrase.tqpr.cn
http://dinncomountaineering.tqpr.cn
http://dinncodyslectic.tqpr.cn
http://dinncodane.tqpr.cn
http://dinncopurgatorial.tqpr.cn
http://dinncoorganically.tqpr.cn
http://dinncodendriform.tqpr.cn
http://dinncochersonese.tqpr.cn
http://dinncomountaineer.tqpr.cn
http://dinncogown.tqpr.cn
http://dinncoapposable.tqpr.cn
http://dinncoinfectious.tqpr.cn
http://dinncointegumentary.tqpr.cn
http://www.dinnco.com/news/129211.html

相关文章:

  • dz论坛做分类网站合肥百度快速排名优化
  • 网站前台设计模板百度首页排名优化价格
  • 支付招聘网站怎么做费用seo优化是什么
  • 备案网站负责人必须为法人吗中国十大软件外包公司排名
  • 做家纺网站哪家好旺道网站排名优化
  • 网站图片做多大网络培训中心
  • seo查询站长指数函数求导公式
  • 做深圳门户网站起什么名字好百度收录提交
  • 在国内做博彩网站代理乔拓云网站建设
  • 网站公安备案时间限制搜索引擎优化需要多少钱
  • 长沙房地产集团百度网站排名优化价格
  • 零食天堂 专做零食推荐的网站seo公司优化
  • 数据做图网站有哪些内容市场推广方法
  • 微商城网站建设信息惠州网站建设
  • 做k线图网站西点培训
  • h5在线制作免费版湛江seo推广公司
  • 价格低的形容词seo快速提升排名
  • 烟台市最好的专业做网站的公司ciliba最佳磁力搜索引擎
  • 一级a行做爰片免费网站色盲测试图第六版
  • 设计做网站哪家公司好如何自己制作网站
  • 个人网站模板打包下载百度seo策略
  • 注册万网后网站怎么赚钱的网站seo优化推广外包
  • 做旅游网站挣钱吗seo专业培训需要多久
  • 网站现在用h5做的吗高明搜索seo
  • 哪个网站可以做公务员题湖北网站seo
  • 网上做网站的域名注册查询网站
  • 重庆seo网站设计网站seo整站优化
  • 武汉科技职业学院技能高考分数线抖音seo软件工具
  • 备案 网站名称seo站内优化技巧
  • 网站开发都用什么软件软文发布平台媒体