我写了一个简单的存储过程,但是不好使,好像是版本的问题
create procedure p1()
begin
declare a int;
declare b int;
set a=5;
set b=6;
insert into t values(a);
end;
错误信息:
错误代码: 1064
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 'declare b int' at line 1
(耗费 0 ms)错误代码: 1193
Unknown system variable 'a'
(耗费 0 ms)错误代码: 1193
Unknown system variable 'b'
(耗费 0 ms)错误代码: 1146
Table 'renwenzhi.t' doesn't exist
(耗费 0 ms)错误代码: 1064
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 'end' at line 1
(耗费 0 ms)
create procedure p1()
begin
declare a int;
declare b int;
set a=5;
set b=6;
insert into t values(a);
end;
错误信息:
错误代码: 1064
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 'declare b int' at line 1
(耗费 0 ms)错误代码: 1193
Unknown system variable 'a'
(耗费 0 ms)错误代码: 1193
Unknown system variable 'b'
(耗费 0 ms)错误代码: 1146
Table 'renwenzhi.t' doesn't exist
(耗费 0 ms)错误代码: 1064
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 'end' at line 1
(耗费 0 ms)
解决方案 »
- 查询录入mysql数据时float类型数据出现误差,怎么回事?
- 我select的时候有一列查不到是怎么回事
- 两个表都有id字段用left join连接后怎么分别获取
- 求 MySQL SQL 查询语句?
- mysql 怎么对于查询结果内容进行有规律的追加
- 哪里可以下到linux下的MYSQL-Server-4.1.18和MYSQL-devel-4.1.18的安装包?
- 在一个表查询一个含有特定字符串的字段的sql语句
- SOS,有人碰到过MYSQL因停电造到一个表的数据全部被清空的情况吗??
- 请教:哪里能下载mysql jdbc驱动程序。急啊!多谢了。
- 使用longblob 存储图片出现的问题
- 设计上的疑问
- mysql中在查询结果中行列互换?
create procedure p1()
begin
declare a int;
declare b int;
set a=5;
set b=6;
insert into t values(a);
end
//
>delimit ;>call p1();
delimiter ||
create procedure p1()
begin
declare a int;
declare b int;
set a=5;
set b=6;
insert into t values(a);
end
||
delimiter ;