month这个参数没有用到,本来存储过程比这要长,我只是贴出了出错的部分
解决方案 »
- 1135Can't create a new thread (errno 12)
- MySQL 5.0不支持中文全文索引吗?我在5.0.77里面是测试,可以搜到结果,不知道很多人所指的mysql不支持中文全文索引是指哪回事?
- 急急急!用工具将Oracle转换为mysql后中文乱码无法消除?
- 任命 liangCK 为MySQL/Postgresql版 版主!
- MYSQL批量修改表的编码
- 請幫忙!delphi連結MySql提示“DBX Error: Invalid Precision.”
- 请问,为什么在WINDOWS下不能够连接到LINUX下的MYSQL数据库?
- 入门问题,mysql.sock是作什么用的?
- MYSQL中有没有可以更新一个字段一部分的方法
- mysql表空间问题
- 求SQL一句(立等,急!!!!!!!!!!!!!!)
- 如何整合JbuilderX和MySql?
Query OK, 0 rows affected (0.00 sec)mysql>
mysql> Delimiter forend
mysql>
mysql> Create Procedure p_report
-> (In para_year Int,
-> In para_month Int,
-> In Id Char(10),
-> Out status Int)
-> Begin
-> Select Year,
-> Month,
-> OfficeId,
-> OnTimeRate
-> From ReportByMonth
-> Where OfficeId = Id And
-> Year = para_year;
->
-> End
->
-> forend
Query OK, 0 rows affected (0.00 sec)mysql>
mysql> Delimiter ;
mysql>
mysql> call p_report(2005,0,"1",@a);
+------+-------+----------+------------+
| Year | Month | OfficeId | OnTimeRate |
+------+-------+----------+------------+
| 2005 | 1 | 1 | 1 |
| 2005 | 2 | 1 | 3 |
| 2005 | 3 | 1 | 4 |
| 2005 | 4 | 1 | 5 |
| 2005 | 5 | 1 | 6 |
| 2005 | 6 | 1 | 7 |
| 2005 | 7 | 1 | 8 |
+------+-------+----------+------------+
7 rows in set (0.00 sec)Query OK, 0 rows affected (0.09 sec)