我写了一个文件:create_procedure.sql
code:use inter;
drop procedure if exists proc_device_db_stroe;   
create procedure proc_device_db_stroe(IN sn varchar(64),IN type int(4))  
begin
set @sqlcmd = 'create table tb_test(id int(4));';
PREPARE stmt FROM @sqlcmd;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
end写了一个批处理命令:create.bat
code:
mysql -h localhost -uroot -p < create_procedure.sql
pause
当我双击执行create.bat文件时提示如下错误:
ERROR 1064 (42000) at line 4: You have an error in your SQL syntax; check the ma
nual that corresponds to your MySQL server version for the right syntax to use n
ear '' at line 3
请问我这个存储过程哪有错误,但是为什么用MYSQL可视化工具执行create_procedure.sql文件中的代码没问题?