MYSQL中使用存储过程中,变量怎么使用
create procedure p
@a char(15)
as
begin
insert into @a (name)
values ('zhangsan')
end
mysql里面是怎么试用表变量的
变量a之前的符号是@shell前面是$MYSQL不支持直接使用变量做表名创建存储过程begin DECLARE dbName VARCHAR(30)
; SET dbName = 'aaa'
; SET @STMT :=CONCAT("CREATE TABLE ",dbName," SELECT id from gamedb;")
; PREPARE STMT FROM @STMT; EXECUTE STMT; END