惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - php、凯

优豆云:免费云服务的宝藏之选 docker xtom无法访问的解决办法 ubuntu 卸载php laravel response返回值精度问题 laravel collet分组 debian 系统搭建rsync+sersync实现实时同步 docker 搭建debian+nginx+php(含composer的扩展)+mysql+mongo+redis lnmp卸载删除多余的php版本 laravel操作mongo详细说明 Laradock中文文档 docker-composer 简单教程 laravel jwt实践 Laravel实现from的curl文件转发 docker添加mongo4.0.3并配置复制集 docker创建mysql5.7.22并配置主从 docker相关内容 Windows7安装 docker-compose的过程 史上最简单的Docker入门教程 MySQL触发器使用详解
存储过程
php、凯 · 2019-05-29 · via 博客园 - php、凯
 1 #删除存储过程
 2 -- drop procedure if exists add_test;  
 3 CREATE PROCEDURE add_test()  
 4   
 5     begin
 6     #定义变量
 7     declare client_id int;
 8     declare shop_id int;
 9 
10     #定义游标位置变量
11     declare local_status int; 
12     
13     #创建游标
14     declare local_message cursor for SELECT id, f_foreign_client_id from (SELECT ts.id as id,ts.f_tel as sf_tel,tc.f_tel as cf_tel,tc.f_foreign_client_id from t_shop as ts LEFT JOIN t_contact as tc ON ts.f_tel = tc.f_tel where ts.f_foreign_client_id = 0 and ts.f_tel <> 0) as a where f_foreign_client_id <> '';
15     
16     #定义游标默认值
17     DECLARE CONTINUE HANDLER FOR NOT FOUND SET local_status=0;
18     #再次设置有女表默认值
19     set local_status=0;
20     
21     #打开游标
22     open local_message;
23     #获取总数量
24     set local_status=(SELECT count(*) from (SELECT ts.id as id,ts.f_tel as sf_tel,tc.f_tel as cf_tel,tc.f_foreign_client_id from t_shop as ts LEFT JOIN t_contact as tc ON ts.f_tel = tc.f_tel where ts.f_foreign_client_id = 0 and ts.f_tel <> 0) as a where f_foreign_client_id <> '');
25     
26     #while循环
27     while local_status>0 do
28     #给游标赋值
29     fetch local_message into shop_id,client_id; #将sql查询出的值赋值给上面的变量
30     
31     #判断数据是否处理完
32     if(local_status>0) then
33     
34     #要处理的sql语句
35     update t_shop set f_foreign_client_id = client_id where id = shop_id;
36      
37     #处理完每条数据之后,需要给游标为值减一 
38     set local_status=(local_status-1);
39     end if;
40     #循环结束
41     end while;
42     
43     #结束游标
44     close local_message;
45     end
46       
47   #调用存储函数add_test  
48 --   CALL add_test()