DELIMITER $$
DROP PROCEDURE IF EXISTS `test`.`myinsert` $$
create procedure `test`.`myinsert`()
begin
declare id int;
declare size long;
declare en longtext;
declare es longtext;
set id = 1;
select count(*) into size from en_es;
while id <= size do
IF (id%2)=1 then
select en_es.seg into en from en_es where en_es.id = id;
else
select en_es.seg into es from en_es where en_es.id = id;
end if;
IF (id%2)=0 then
##select en,es;
insert into result values(null, en, es);
set en=NULL,es=NULL;
end if;
set id = id + 1;
end while;
end$$
DELIMITER ;
call myinsert();
分享到:
相关推荐
这个是本人在学习MySQL数据库时的一个小的总结,希望对大家有用。主要是关于如何在MySQL中创建procedure、function、trigger.
mysql procedure源码for mysql-essential-5.1.55-win32
Debugger for MySQL offers a balanced set of advanced debugging features that will help you minimize the time needed for managing and testing even the most complex stored functions and procedures....
本文实例讲述了php mysql procedure实现获取多个结果集的方法。分享给大家供大家参考,具体如下: protected function getRs($id) { $db = new mysqli(C("DB_HOST"), C("DB_USER"), C("DB_PWD"), C("DB_NAME"), C...
mysql存储过程方面的圣经,以通俗的示例方法讲述mysql存储过程的深奥内容,In MySQL Stored Procedure Programming, they put that hard-won experience to good use. Packed with code examples and covering ...
The implementation of stored procedures in MySQL 5.0 ... This book, destined to be the bible of stored procedure development, is a resource that no real MySQL programmer can afford to do without.
mysql stored procedure programming PDF version
非常简单的一个C#源码文件,C#接收存储过程输出参数。
用于将Microsoft SQL Server存储过程转换为MySQL的工具。
1 用mysql客户端登入 2 选择数据库 mysql>use test 3 查询当前数据库有哪些存储过程 mysql>show procedure status where Db=’test’ 4 创建一个简单的存储过程 mysql>create procedure hi() select ‘hello’;...
Mysql frequently used database engine;Mysql procedure; Mysql query sql for tree data structure.
MYSQL存储过程技术。主要讲解常用存储过程写法。
MySQL Stored Procedure Programming Advance Praise for MySQL Stored Procedure Programming Preface Objectives of This Book Structure of This Book What This Book Does Not Cover Conventions ...
存储过程(Stored Procedure)是一组为了完 成特定功能的 SQL 语句集,经编译后存储在数据库中。用户通过指定存储过程的名字并给 出参数(如果该存储过程带有参数)来执行它。存储过程是数据库中的一个重要对象,...
这是MYSQL5数据库服务器中存储过程实现部分的分过程控制程序.运用了PLSQL语言来达MYSQL数据库中分表功能,体现了系统的整体性能...
官方MySQL 存储过程教程的中文版 以及jdbc中调用MYSQL存储过程的详细例子
主要为大家详细介绍了mysql存储过程中的异常处理,感兴趣的小伙伴们可以参考一下
Mysql Stored Procedure