mysql 5
表结构如下:存储方式为innodb
table :
bug(id(自动增加,主键,int),name char(50),note char(50))
file(bid int foreign key(bid) references bug(id),filename char(50))
创建存储过程如下:create proc upproc
(@name char(50),@note char(50))
as
declare @id int
begin
insert into bug(name,note)
values(@name,@note)select @id=@@IDENTITY
insert into file(bid,filename) 
select @id,@note
end
go错误如下:
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 'proc upproc
(@name char(50),@note char(50))
as
declare @id int
begin
insert' at line 1