MySQL PLSQL Demo - 003.静态游标
drop procedure if exists p_hello_world; create procedure p_hello_world()
begin
declare id integer;
declare username varchar(256);
declare result varchar(4000) default '';
/* don't work */
/*declare cur_user cursor for select id from p_user where id is not null and name is not null order by id;*/
declare cur_user cursor for select t.id, t.name from p_user t where t.id is not null and t.name is not null order by t.id;
declare continue handler for SQLSTATE '' set id = null;
open cur_user;
fetch cur_user into id, username;
while (id is not null) do
set result = concat(result, 'id:', id, 'username:', username, ';');
fetch cur_user into id, username;
end while;
close cur_user;
select result;
end; call p_hello_world();
MySQL PLSQL Demo - 003.静态游标的更多相关文章
- 【MySQL】MySQL PLSQL Demo - 006.循环(WHILE DO and FOR LOOP)
WHILE DO drop procedure if exists p_while_do; create procedure p_while_do() begin declare i int; ; d ...
- MySQL PLSQL Demo - 005.IF THEN ELSEIF THEN ELSE END IF
drop procedure if exists p_hello_world; create procedure p_hello_world(in v_id int) begin ) then sel ...
- MySQL PLSQL Demo - 002.变量定义、赋值
drop procedure if exists p_hello_world; create procedure p_hello_world() begin declare v_number int; ...
- MySQL PLSQL Demo - 001.创建、调用、删除过程
drop procedure if exists p_hello_world; create procedure p_hello_world() begin select sysdate(); end ...
- Mysql 存储过程中使用多游标
Mysql 存储过程中使用多游标 drop procedure IF EXISTS test_proc_1; create procedure test_proc_1() begin ; ) ; ) ...
- java jdbc使用SSH隧道连接mysql数据库demo
java jdbc使用SSH隧道连接mysql数据库demo 本文链接:https://blog.csdn.net/earbao/article/details/50216999 packag ...
- sulin Python3.6爬虫+Djiago2.0+Mysql --实例demo
1.切换到项目目录下,启动测试服务器 manage.py runserver 192.168.0.108:8888 2.设置相关配置 项目目录展示如下: beauty=>settings.py ...
- Oracle PLSQL Demo - 20.弱类型REF游标[没有指定查询类型,也不指定返回类型]
declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_ename ); v_deptno ); v ...
- Oracle PLSQL Demo - 17.游标查询个别字段(非整表)
declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_empno scott.emp.empno% ...
随机推荐
- [模式识别].(希腊)西奥多里蒂斯<第四版>笔记5之__特征选取
1,引言 有关模式识别的一个主要问题是维数灾难.我们将在第7章看到维数非常easy变得非常大. 减少维数的必要性有几方面的原因.计算复杂度是一个方面.还有一个有关分类器的泛化性能. 因此,本章的主要任 ...
- 算法笔记_211:第七届蓝桥杯软件类决赛部分真题(Java语言A组)
目录 1 阶乘位数 2 凑平方数 3 棋子换位 4 机器人塔 前言:以下代码仅供参考,若有错误欢迎指正哦~ 1 阶乘位数 阶乘位数 9的阶乘等于:362880 它的二进制表示为:10110001001 ...
- vue单文件(sfc)编译为js的流程
1.流程 2.参考文章地址 https://segmentfault.com/a/1190000012336392 3.Vue框架的parseComponent https://github.com/ ...
- webservice系统学习笔记3-分析wsdl文件的组成
详细分析前面章节的服务的wsdl文件 1.http://localhost:8888/ws01?wsdl 2.http://localhost:8888/ws01?xsd=1 在接口服务中添加复杂类型 ...
- Python之reduce
# -*- coding: utf-8 -*- #python 27 #xiaodeng #Python之reduce #http://python.jobbole.com/82597/ #1)red ...
- SpringMVC 类内部的RequestMapping注解能否被继承?
首先注意标题,说的是类内部的注解 结论是: 不能,但是子类却可以享有父类中该注解带来的效果. 看了一下这个:http://elf8848.iteye.com/blog/1621392 自己也试了一下, ...
- Swift内存管理、weak和unowned以及两者区别(如何使用Swift 中的weak与unowned?)
Swift 是自动管理内存的,这也就是说,我们不再需要操心内存的申请和分配. 当我们通过初始化创建一个对象时,Swift 会替我们管理和分配内存.而释放的原则遵循了自动引用计数 (ARC) 的规则:当 ...
- Web前端开发必备工具推荐
http://gaohaixian.blog.163.com/blog/static/12326010520114265223489/不管你做前端开发还是网页重构,前端工具都起着非常重要的作用,这里向 ...
- List Set Map以及子接口用法总结(转)
Collection ├List│├LinkedList│├ArrayList│└Vector│ └Stack└SetMap├Hashtable├HashMap └WeakHashMap list 和 ...
- oc set/get方法
新建一个“Cocoa Touch Class”文件,命名为People People.h 写入 @interface People : NSObject @property int age; @end ...