WHICH ONE IS BETTER FOR NEWBIE?
DROP PROCEDURE IF EXISTS w_array;
DELIMITER /w/
CREATE PROCEDURE w_array (w_arr VARCHAR(36))
BEGIN
WHILE (LOCATE(',', w_arr) > 0)
DO
SET @w = LOCATE(',', w_arr);
SET @wtab = SUBSTRING_INDEX(w_arr,',',1);
SET @wtab = CONCAT('grab_reviews_',@wtab); SET @wtmp = CONCAT('UPDATE ',@wtab,' SET asin=exact_asin ');
PREPARE stmt FROM @wtmp ;
EXECUTE stmt ;
DROP PREPARE stmt; SET w_arr=SUBSTRING(w_arr,@w+1); END WHILE; SET @wtab = CONCAT('grab_reviews_',w_arr);
SET @wtmp = CONCAT('UPDATE ',@wtab,' SET asin=exact_asin ');
PREPARE stmt FROM @wtmp ;
EXECUTE stmt ;
DROP PREPARE stmt; END/w/
DELIMITER;
CALL w_array('us,jp,uk,de,fr,ca,es,it,mx,in');
<?php
$warr = array('us', 'jp', 'uk', 'de', 'fr', 'ca', 'es', 'it', 'mx', 'in');
$sql = 'UPDATE grab_reviews_';
$w = '';
foreach ($warr AS $one) {
$w .= 'UPDATE grab_reviews_' . $one . ' SET asin=exact_asin ; ';
}
echo $w;
DROP PROCEDURE IF EXISTS w_array;
DELIMITER /w/
CREATE PROCEDURE w_array ()
BEGIN
SET @w_arr = 'us,jp,uk,de,fr,ca,es,it,mx,in';
WHILE (LOCATE(',', @w_arr) > 0)
DO
SET @w = LOCATE(',', @w_arr);
SET @wtab = SUBSTRING_INDEX(@w_arr,',',1);
SET @wtab = CONCAT('grab_reviews_',@wtab); SET @wtmp = CONCAT('UPDATE ',@wtab,' SET asin=exact_asin ');
PREPARE stmt FROM @wtmp ;
EXECUTE stmt ;
DROP PREPARE stmt; SET @w_arr=SUBSTRING(@w_arr,@w+1); END WHILE; SET @wtab = CONCAT('grab_reviews_',@w_arr);
SET @wtmp = CONCAT('UPDATE ',@wtab,' SET asin=exact_asin ');
PREPARE stmt FROM @wtmp ;
EXECUTE stmt ;
DROP PREPARE stmt; END/w/
DELIMITER;
CALL w_array;
WHICH ONE IS BETTER FOR NEWBIE?的更多相关文章
- Tips for newbie to read source code
This post is first posted on my WeChat public account: GeekArtT Reading source code is always one bi ...
- A funny story in regard to a linux newbie
ZZ from here : ask what kernel ring buffer is A few days ago I started thinking that my linux educa ...
- The Kernel Newbie Corner: Kernel Debugging with proc "Sequence" Files--Part 3
转载:https://www.linux.com/learn/linux-career-center/44184-the-kernel-newbie-corner-kernel-debugging-w ...
- The Kernel Newbie Corner: Kernel Debugging with proc "Sequence" Files--Part 2
转载:https://www.linux.com/learn/linux-career-center/39972-kernel-debugging-with-proc-qsequenceq-files ...
- The Kernel Newbie Corner: Kernel Debugging Using proc "Sequence" Files--Part 1
转载:https://www.linux.com/learn/linux-career-center/37985-the-kernel-newbie-corner-kernel-debugging-u ...
- (Frontend Newbie) Web三要素(一)
上一篇简单了解了Web发展的简要历史,本篇简单介绍前端开发的基本三要素:HTML.CSS.JavaScript中的HTML以及一些在开发.学习过程中易被忽视的知识点. HTML HTML全称是超文本标 ...
- 【CodeForces 312B】BUPT 2015 newbie practice #3A Archer
题 SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the targ ...
- 【CodeForces 605A】BUPT 2015 newbie practice #2 div2-E - Sorting Railway Cars
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102419#problem/E Description An infinitely lon ...
- 【UVALive 3905】BUPT 2015 newbie practice #2 div2-D-3905 - Meteor
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102419#problem/D The famous Korean internet co ...
- 【HDU 4925】BUPT 2015 newbie practice #2 div2-C-HDU 4925 Apple Tree
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102419#problem/C Description I’ve bought an or ...
随机推荐
- iOS_文件上传进度条的实现思路-AFNettworking
iOS_文件上传进度条的实现思路-AFNettworking //要上传的文件名,在这里我使用当前日期做为文件的名称 NSString * fileName =[NSString stringWith ...
- python将str转换成字典
典型的应用场景:Json数据的解析 >>> user "{'name' : 'jim', 'sex' : 'male', 'age': 18}" >> ...
- oracle中空值null的判断和转换:NVL的用法
1.NULL空值概念 数据库里有一个很重要的概念:空值即NULL.有时表中,更确切的说是某些字段值,可能会出现空值, 这是因为这个数据不知道是什么值或根本就不存在. 2.NULL空值判断 空值不等同于 ...
- XML-RPC使用手册
内容列表 Preface: About This Manual Introduction to XML-RPC for C/C++ What is XML-RPC? How Does XML-RPC ...
- Spider Studio 社区信息
Spider Studio (采集工作站) 产品页面: http://www.gdtsearch.com/products.spiderstudio.htm QQ群: 45995410 - 有人驻场解 ...
- Scala中List(Map1,Map2,Map3 ....) 转成一个Map
这个问题研究好久...头大,不记得有fold用法了. fold函数:折叠,提供一个输入参数作为初始值,然后大括号中应用自定义fun函数并返回值. list.fold(Map()){(x,y)=> ...
- jQuery分页小插件
源码如下: $.fn.pager = function (pagerInfo) { var recordCount = this.size(); if (recordCount <= pager ...
- clone命令
git clone <repository> <directory> git clone https://nulab.backlog.jp/git/BLG/tutorial.g ...
- bootstrap基础学习七篇
bootstrap图片 Bootstrap 提供了三个可对图片应用简单样式的 class: .img-rounded:添加 border-radius:6px 来获得图片圆角. .img-circle ...
- 1 week110的zookeeper的安装 + zookeeper提供少量数据的存储
随时查看,zookeeper企业里公认的最新文档版本! https://archive.apache.org/dist/ 下面是在weekend110上的zookeeper的安装 在 ...