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 ...
随机推荐
- android.animation(4) - ObjectAnimator的ofInt(), ofFloat()(转)
一.概述 1.引入 上几篇给大家讲了ValueAnimator,但ValueAnimator有个缺点,就是只能对数值对动画计算.我们要想对哪个控件操作,需要监听动画过程,在监听中对控件操作.这样使用起 ...
- CXCommon.h工具类
#ifndef __XCOMMON_H__ #define __XCOMMON_H__ /******************************************************* ...
- jquery的商品首页
js代码: $(function() { /*新闻滚动*/ var $this = $('.scrollNews'); var scrollTimer; $this.hover(function () ...
- private继承的作用
这里有个demo,里面的Stack<T*> : private Stack<void *>,作者对此的解释如下 The partial specialization for o ...
- django 运行不同的settings
python manage.py runserver --settings=EMCRP.settings_local
- webservice文件上传下载
使用DataHandler实现webservice的文件上传下载 服务端代码: package com.hello.weChat.controller; import javax.activation ...
- 重启php
注意这是重启php,不是重启apache service php-fpm restart
- treegrid-dnd.js
(function($){ $.extend($.fn.treegrid.defaults, { onBeforeDrag: function(row){}, // return false to d ...
- 解决阿里云部署 office web apps ApplicationFailedException 报错问题
查找这个问题,确实花费了很长时间,所以具体解析一下问题原因吧. 报错如下: 问题详情链接 New-OfficeWebAppsFarm:Office Online服务无法启动.有关详细信息,请参阅Win ...
- PHP Global定义全局变量使用说明
Global是php中一个比较特殊的命令,大家直接叫他超级全局变量了,下面我来介绍我今天在使用Global定义全局学习笔记了 很不习惯PHP中的变量作用域,PHP中函数变量和全局是完全隔绝的,也就 ...