为什么我在动态执行下面这个SQL的时候,总是报"无效SQL语句"
declare
v_sql_table_analyze  varchar2(200):='exec dbms_stats.gather_table_stats(ownname=>''PARAMS'',tabname => ''TB_BRANCH'',estimate_percent => 20,degree => 5)';
begin
execute immediate v_sql_table_analyze;
end;修改成:
declare
begin
exec dbms_stats.gather_table_stats(ownname=>'PARAMS',tabname => 'TB_BRANCH',estimate_percent => 20,degree => 5);
end;
又报错:
ORA-06550: 第 4 行, 第 6 列: 
PLS-00103: 出现符号 "DBMS_STATS"在需要下列之一时:
 := . ( @ % ;
符号 ":=" 被替换为 "DBMS_STATS" 后继续。