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

公司自己做网站备案wordpress链接出错

公司自己做网站备案,wordpress链接出错,优化优化,一个新产品的营销方案存储过程中的流程控制 在存储过程中支持流程控制语句用于实现逻辑的控制 一、分支语句 语法#xff1a;if-then-else 1.单分支语句 语法 if conditions then ——SQL end if; if conditions then——SQLend if; ——如果参数a的值为1#xff0c;则添加一条班级信息 …存储过程中的流程控制 在存储过程中支持流程控制语句用于实现逻辑的控制 一、分支语句 语法if-then-else 1.单分支语句 语法 if conditions then ——SQL end if; if conditions then——SQLend if; ——如果参数a的值为1则添加一条班级信息 案例 创建一个储存过程如果参数a的值为1则添加一条班级信息 代码实现 创建存储过程 #创建一个储存过程 create procedure proc_test7(in a int) begin#单分支 if语句if a1 theninsert into classes(name,class_remark) values(Java2204,test);end if; end; #———如果参数a的值为1则添加一条班级信息 调用存储过程 #调用存储过程 call proc_test7 (1); call proc_test7 (2);运行结果 创建存储过程 调用存储过程 2.双分支语句 双分支如果条件成立执行SQL1否则执行SQL2 语法 if conditions then  ——SQL1 else ——SQL2 end if; if conditions then ——SQL1else——SQL2end if; 案例 如果参数为1创建学生信息如果参数不为1创建班级信息 代码实现 创建存储过程 #创建存储过程 create procedure proc_test8(in a int) beginif a1 theninsert into classes(name,class_remark) values(Java2208,test);elseinsert into students(stu_num,name ,stu_gender,stu_age,cid)values(20220110,小虎,女,19,1);end if; end; 调用存储过程 #调用储存过程 call proc_test8 (1); call proc_test8 (3); 运行结果 创建存储过程 调用储存过程 3.switch case语句 语法 create procedure 储存过程名(参数) begin case a when 1 then 执行的SQL语句1 when 2 then 执行的SQL语句2 else 执行的SQL语句3 end case; end; create procedure 储存过程名(参数)begincase awhen 1 then执行的SQL语句1when 2 then执行的SQL语句2else执行的SQL语句3end case;end; 案例 case 多分支语句 代码实现 创建储存过程 create procedure proc_test9(in num int) begincase numwhen 1 then#如果a的值为1执行以下操作insert into classes(name,class_remark) values(Java2208,test);when 2 then#如果a的值为2执行以下操作insert into students(stu_num,name ,stu_gender,stu_age,cid)values(20220111,小刚,男,22,2);else#如果a的值不为1也不为2执行以下操作update students set stu_age18 where stu_num 20220110;#修改学生年龄end case; end;调用储存过程 #调用储存过程 call proc_test9 (2); call proc_test9 (3);运行结果 创建储存过程 调用储存过程 二、循环语句 1.while循环 语法 create procedure 储存过程名传递的参数 begin declare i int        #局部变量 set i0        #局部变量赋值 while 循环条件 do SQL语句 end while;        #结束循环 end;                        #结束储存过程 create procedure 储存过程名传递的参数begindeclare i int        #局部变量set i0        #局部变量赋值while 循环条件 doSQL语句end while;        #结束循环end;                        #结束储存过程 案例 代码实现 创建储存过程 #while循环 创建储存过程 create procedure proc_test10(in num int) begindeclare i int;set i0;while inum doinsert into classes (name,class_remark)values(concat(Java,i),......);#concat()拼接字符串函数set ii1;end while; end;调用储存过程 #调用储存过程 call proc_test10 (4); 运行结果 创建储存过程 调用储存过程 执行结果 编号自动增加 2.repeat循环 案例 代码实现 创建储存过程 #repeat循环 #创建储存过程 create procedure proc_test11(in num int) begindeclare i int;set i1;repeatinsert into classes (name,class_remark)values(concat(C,i),......);#concat()拼接字符串函数set ii1;#循环结束条件 类似于do while语句until inumend repeat; end;调用储存过程 #调用储存过程 call proc_test11 (4); 运行结果 创建储存过程 调用储存过程 执行结果 3.loop循环 语法 create procedure 储存过程名参数 begin declare i int;        #定义局部变量 set i0;                #赋值局部变量 myloop:loop        #给loop循环起名 执行的SQL语句; set ii1        #迭代语句 if inum then  #循环结束条件 leave myloop; end if;             #结束判断 end loop;                #结束循环 end; create procedure 储存过程名参数begindeclare i int;        #定义局部变量set i0;                #赋值局部变量myloop:loop        #给loop循环起名执行的SQL语句;set ii1        #迭代语句if inum then  #循环结束条件leave myloop;end if;             #结束判断end loop;                #结束循环end; 案例 创建储存过程 loop 循环判断 代码实现 创建储存过程 #创建储存过程 # loop 循环判断 create procedure proc_test12(in num int) begindeclare i int;set i0;myloop:loopinsert into classes (name,class_remark)values(concat(Python,i),......);set ii1;if inum thenleave myloop;end if;end loop; end; 调用储存过程 #调用储存过程 call proc_test12(4); 运行结果 创建储存过程 调用储存过程 执行结果
http://www.hkea.cn/news/14457354/

相关文章:

  • 长沙门户网站做网站使用什么语言写
  • 同一ip大量访问网站一二三四高清视频免费观看
  • 中国传统色彩网站建设方案wordpress没有幻灯片
  • 万网注册的网站长时间不能访问是不是被封了公司网站怎么设计制作
  • 聊城做企业网站深圳企业网站制作公司哪家好
  • 专门做网站开发的公司jn建站系统
  • 建设手机网站平台网站的ftp帐号
  • 制作网制作网站建设的公司网站建设去哪里学
  • 做化学合成的网站有哪些可以网站可以做免费的文案广告语
  • 英文网站群建设厂家高端网站设计地址
  • 苏州网站建设选苏州梦易行软件开发下载
  • 网站二级目录是什么洛阳网站建设费用
  • 安徽网站优化多少钱南充市住房建设局网站
  • 电商网站建设事例甘肃网站备案审核
  • 学校网站源码php河南省建设注册执业中心网站
  • wordpress一数据库多网站建工社官网
  • 贵州网站公司网站怎么做留言区
  • 电商网站建设内容经典网络营销案例
  • 深圳设计公司企业网站做视频网站要多大的带宽
  • 网站添加百度商桥微信小程序订货系统
  • 网站 分站深圳市高端网站建设
  • 微信分销网站建设比较好wordpress调用几个分类置顶文章
  • 做网站用什么软件好广州app开发公司排名十强
  • 长虹电视网站建设中建设什么样的网站月入一万
  • 创建门户网站做中国最专业的健康门户网站
  • 长沙麓谷建设发展有限公司网站富德生命人寿保险公司官方网站
  • 做网站材料企业网站设计行业
  • 学校网站建设内容设计网站建设需要考哪些证
  • 网站首页大小vi公司设计包括哪些
  • 简洁 手机 导航网站模板下载安装移动互联和网站开发哪个好