MySQL版本5.0.13以上
create table aa (id int);
delimiter //
create procedure test(v_sql varchar(200))
begin
set @sqltext:=concat('insert into aa ',v_sql);
prepare stmt from @sqltext;
execute stmt;
DEALLOCATE PREPARE stmt;
end;
//
call test('values (1)')//
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/94041/viewspace-924600/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/94041/viewspace-924600/