delimiter //
create procedure aa()
begin
declare x varchar(20);
set x='hjl';
if length(x)=3 then
select x;
endif;
end
//为什么老报错??
create procedure aa()
begin
declare x varchar(20);
set x='hjl';
if length(x)=3 then
select x;
endif;
end
//为什么老报错??
解决方案 »
- ubuntu系统mysql中文乱码
- fulltext的索引短字符串问题
- ADO连接数据库mysql5.1Error:msado15.dll access violation
- 急!就一个修改语句
- 关于同一字段多作者统计发文的请教
- 不能导出Mysql数据库.怎么回事?
- 数据库存储大二进制文件的问题--倾家荡产了
- 关于MYsql1.4版本的图形用户界面问题高手进来看看急!!!!!!
- mysql里有设置日期格式的环境变量吗?
- 请问mysql的什么版本才开始支持子查询?
- 大家都用过xtranbackup1.6吗?设置了innodb_file_per_table的话,如何备份呢?
- phpMyAdmin安装无法打开登陆界面,求解(附操作过程)
你什么意思?
-> begin
-> declare x varchar(20);
-> set x='a';
-> if length(x)=3 then
-> select x;
-> end if;
-> end
-> //
Query OK, 0 rows affected (0.00 sec)
-> begin
-> declare x varchar(20);
-> set x='hjl';
-> if length(x)=3 then
-> select x;
-> endif;
-> end
-> //
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 ';
end' at line 7
mysql>错误提示很清楚了,你的第七行endif;。有问题,然后你就可以看一下MYSQL手册中的语法,就立即明白 end if