MariaDB社区

标题: 在MySql中创存储过程出错 请各位帮忙看一下 [打印本页]

作者: liangliwen    时间: 2009-5-17 18:57
标题: 在MySql中创存储过程出错 请各位帮忙看一下
MySql版本是5.1的

create procedure proc_bb
@a nvarchar(200),
@b nvarchar(200)
AS
  declare @sql nvarchar(5000)
set @sql='select * from bb where 1=1'
if @b<>''
begin
set @sql+=' and [email=b=]b='''+@b+'''[/email] '
end
if @a<>''
begin
set @sql+=' and [email=a=]a='''+@a+'''[/email] '
end

报的错误提示:
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 [email=]'@a[/email] nvarchar(200),
@b nvarchar(200)
AS
  declare @sql nvarchar(5000)
set @sql='' at line 2




欢迎光临 MariaDB社区 (http://123.56.88.72/) Powered by Discuz! X3.2