请看下面,
mysql> show procedure status ;
+--------+-------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+--------+-------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| nasdaq | inc | PROCEDURE | root@localhost | 2010-08-04 19:43:31 | 2010-08-04 19:43:31 | DEFINER | | latin1 | latin1_swedish_ci | latin1_swedish_ci |
| nasdaq | sCode | PROCEDURE | root@localhost | 2010-08-04 23:53:49 | 2010-08-04 23:53:49 | DEFINER | | latin1 | latin1_swedish_ci | latin1_swedish_ci |
+--------+-------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
2 rows in set (0.04 sec)mysql> drop procedure inc;
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '��' at line 1
mysql> drop procedure inc;
Query OK, 0 rows affected (0.00 sec)mysql> drop procedure sCode;
Query OK, 0 rows affected (0.00 sec)mysql> source /home/pt/test.sql;
Query OK, 0 rows affected (0.00 sec)mysql> call sCode();
-> ;
-> q
-> quit
-> ;
-> ^CCtrl-C -- exit!
Aborted
pt@pt-laptop:~$
我的mysql控制台,最近总是出现问题,明明命令输入完了,按下回车键,mysql出现-》标记,不立即执行,我只能按下ctr+c退出到shell,重新进入mysql,请问,问题出在哪里?
mysql> show procedure status ;
+--------+-------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+--------+-------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| nasdaq | inc | PROCEDURE | root@localhost | 2010-08-04 19:43:31 | 2010-08-04 19:43:31 | DEFINER | | latin1 | latin1_swedish_ci | latin1_swedish_ci |
| nasdaq | sCode | PROCEDURE | root@localhost | 2010-08-04 23:53:49 | 2010-08-04 23:53:49 | DEFINER | | latin1 | latin1_swedish_ci | latin1_swedish_ci |
+--------+-------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
2 rows in set (0.04 sec)mysql> drop procedure inc;
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '��' at line 1
mysql> drop procedure inc;
Query OK, 0 rows affected (0.00 sec)mysql> drop procedure sCode;
Query OK, 0 rows affected (0.00 sec)mysql> source /home/pt/test.sql;
Query OK, 0 rows affected (0.00 sec)mysql> call sCode();
-> ;
-> q
-> quit
-> ;
-> ^CCtrl-C -- exit!
Aborted
pt@pt-laptop:~$
我的mysql控制台,最近总是出现问题,明明命令输入完了,按下回车键,mysql出现-》标记,不立即执行,我只能按下ctr+c退出到shell,重新进入mysql,请问,问题出在哪里?
解决方案 »
- C#MySql不定时出现Unable to connect to any of the specified MySQL hosts
- auto_increment满了
- pgsql插入日期
- 请教两个表之间的怎样建立条件关系问题
- COMMIT 的作用是让 SQL 语句生效吧?
- 按分组取每日最大值、最小值和差值
- Linux 开机自启动 mysql
- 游标使用错误
- mysql重装出现1067错误,can't connect mysql on localhost(10061),以前的贴都不能解决
- 跨库操作问题?
- 源码安装mysql5.1发现不支持innodb ,如何配置才能让他支持
- 我的mysql出现了问题
估计这个文件中有DELIMITER重置。
create procedure conmax()
begin
declare icode varchar(10);
declare cur_conmax cursor for (select symbol from quote group by symbol);
declare exit HANDLER for not found close cur_conmax;
create table tempTable select * from test.quote where symbol='YHOO';
delete from tempTable;
open cur_conmax;
repeat
fetch cur_conmax into icode;
set @sql = concat(' insert into tempTable select * from `',icode,'` order by close desc limit 5 ;');
PREPARE stmt1 FROM @sql;
EXECUTE stmt1 ;
DEALLOCATE PREPARE stmt1;
until 0 end repeat;
close cur_conmax;
end;
$$
请问,哪句话是重置呢?
create procedure conmax()
begin
declare icode varchar(10);
declare cur_conmax cursor for (select symbol from quote group by symbol);
declare exit HANDLER for not found close cur_conmax;
create table tempTable select * from test.quote where symbol='YHOO';
delete from tempTable;
open cur_conmax;
repeat
fetch cur_conmax into icode;
set @sql = concat(' insert into tempTable select * from `',icode,'` order by close desc limit 5 ;');
PREPARE stmt1 FROM @sql;
EXECUTE stmt1 ;
DEALLOCATE PREPARE stmt1;
until 0 end repeat;
close cur_conmax;
end;
$$
delimiter ;
create procedure conmax()
begin
。。
end;
$$
delimiter ; --最后写完存储过程 要改回来