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?的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. (Frontend Newbie) Web三要素(一)

    上一篇简单了解了Web发展的简要历史,本篇简单介绍前端开发的基本三要素:HTML.CSS.JavaScript中的HTML以及一些在开发.学习过程中易被忽视的知识点. HTML HTML全称是超文本标 ...

  7. 【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 ...

  8. 【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 ...

  9. 【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 ...

  10. 【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 ...

随机推荐

  1. CentOS搭建Nginx+Subversion环境(包括多个版本库的配置)

    Apache Subversion(简称SVN,svn) 因为某种原因我们需要用Nginx作为Subversion的http前端,但目前没有现成的Nginx+Subversion搭配方式. 而Subv ...

  2. print()函数的end 参数

    print()函数含end参数时:结束的时候已什么结尾,后面的参数可以是任何形式 [print() 默认以'\n'  结尾] 输出结果:  print()函数不含end参数时: 输出结果:

  3. SQL Server 2014 Agent 无法启动

    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">- <System& ...

  4. 由于link顺序错误导致的undefined reference

    其实我之前就遇到过这个问题,也强调过,GNU-G++在link阶段是依赖输入的.o或者.a文件的顺序的.如果顺序错误会导致undefined reference错误 见这篇随笔:http://www. ...

  5. DOM方法 getElementsByName()方法

    http://www.imooc.com/code/1583 getElementsByName()方法 返回带有指定名称的节点对象的集合. 语法: document.getElementsByNam ...

  6. LinQ的简单使用

    1.LinQ to Sql类(NET Language Integrated Query (LINQ) ) LINQ定义了大约40个查询操作符,如select.from.in.where以及order ...

  7. saveFileDialog对话框

    private void button1_Click(object sender, EventArgs e) { saveFileDialog1.Filter = "*.txt|*.txt| ...

  8. 2018-11-21 ko.pureComputed的使用

    以前一直在想,ko.pureComputed 好像用不上.看起来高大上. 今天在修复一个bug时,发现了它的妙处. 在修改商品列表的页面,弹出一个新增商品的页面.关闭之后,怎么通知修改商品列表的页面发 ...

  9. nginx 的 autoindex on首页不显示的问题 按照下面几行要写上不然不行

    [root@test html]# vim ../conf/nginx.confworker_processes  1;events {    worker_connections  1024;}ht ...

  10. PHP 安全三板斧:过滤、验证和转义之转义篇 & Blade模板引擎避免XSS攻击原理探究

    PHP 转义 实现 把输出渲染成网页或API响应时,一定要转义输出,这也是一种防护措施,能避免渲染恶意代码,造成XSS攻击,还能防止应用的用户无意中执行恶意代码. 我们可以使用前面提到的 htmlen ...