在函数中执行execute语句报如上的错误,脚本如下:
delimiter //
drop function if exists ClassType//
create function ClassType(v_dbid int) returns int 
begin  
  declare Res numeric;
  prepare stml from 'select t.type into Res from DBCATLOG t where t.dbid=?';
  set @v_id:=v_dbid;
  execute stml using @v_id;
  drop prepare stml;
  return Res;
end;
//
ERROR 1336 (0A000): Dynamic SQL is not allowed in stored function or trigger
mysql> 
同时,如果我写一个关于insert的触发器,而且在触发器内部call 存储过程A,而A中也含有execute语句时,也会报这种错误?
请问,对于这种问题有什么直接或间接的解决方法吗?