易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql过程游标

DELIMITER $$
DROP PROCEDURE IF EXISTS `heli`.`prodtest` $$
CREATE PROCEDURE `heli`.`prodtest` ()
BEGIN
  /*局部变量的定义 declare*/
  declare pid varchar(45) default '';
  declare pq int default 0;
  declare pk double default 0.0;
  declare cur1 CURSOR FOR SELECT product_id,product_quantity,product_kg from productstock;
  /* 游标异常后设置pid为NULL */
  declare CONTINUE HANDLER FOR SQLSTATE '02000' SET pid = null;
  /*开游标*/
     OPEN cur1;
        FETCH cur1 INTO pid,pq,pk;
        WHILE (pid is not null) DO
            /* dosomething */
            select pid,pq,pk;
            FETCH cur1 INTO pid,pq,pk;
        END WHILE;
     CLOSE cur1;
END $$
DELIMITER ;


相关文档:

mysql 4.1以上版本中文乱码解决方法集锦

mysql 4.1的改变造成的乱码解决方法
第一个方法:
MySQL 4.1 中文乱码的问题
最近要将 MySQL 4.0 升级到 MySQL 4.1 ,发现了中文乱码的问题,希望以下见解对大家有用。
1. MySQL 4.1 在文字上有很大改进,它有了 Character Set 与 Collation 的慨念。
2. 在 MySQL 4.0 ,一般的程式都会将文字以拉丁文 ( latin)  ......

mysql的master/slave数据同步配置[转]

我的测试环境.基本上数据是瞬间同步,希望对大家有帮助

redhat 9.0
mysql3.23.57


mysql数据同步备份

A服务器: 192.168.1.2 主服务器master
B服务器: 192.168.1.3 副服务器slave


A服务器设置

#mysql –u root –p
mysql>GRANT FILE ON *.* TO backup@192.168.1 ......

mysql单机多实例运行实践(1)

1.install mysql
get mysql
http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.1/mysql-5.1.41-linux-i686-icc-glibc23.tar.gz
[root@localhost mysql]# tar -zxvf mysql-5.1.41-linux-i686-icc-glibc23.tar.gz
[root@localhost mysql]# cd mysql-5.1.41-linux-i686-icc-glibc23
[root@localhost mysql]# vim RE ......

how to install apache, PHP and MySQL on Linux 2

how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled
with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE
9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all
Linux-like operating ......

how to install apache, PHP and MySQL on Linux 3

how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled
with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE
9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all
Linux-like operating ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号