本帖最后由 qinar 于 2012-9-7 14:20 编辑
我写了个存储过程如下:- create procedure pic_suz(img_url varchar(200))
- begin
- DECLARE tmp varchar(255) DEFAULT 'aaaaaa';
- if left(img_url,7)="http://" then
- tmp=img_url;
- else
- tmp=RIGHT(img_url,LENGTH(img_url)-INSTR( img_url,"http://" )+1);
- select tmp;
- end;
复制代码 一直提示一下错误信息:
CREATE PROCEDURE pic_suz( img_url VARCHAR( 200 ) ) BEGIN DECLAREtmp VARCHAR( 255 ) DEFAULT 'aaaaaa';
MySQL 返回: #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 '' at line 3
大家请指导一下 |