SQL> create or replace procedure wcm_anly as
2 begin
2 analyze table chnldoc compute statistics;
3 analyze index IDX_CHNLdoc_1 compute statistics;
4 analyze index IDX_CHNLdoc_2 compute statistics;
5 analyze table document compute statistics;
6 analyze index IDX_DOC_1 compute statistics;
7 analyze table dockeyword compute statistics;
8 analyze index IDX_DOCKEYWORD_1 compute statistics;
9 end;
10 /
Warning: Procedure created with compilation errors
SQL> show error
Errors for PROCEDURE TRSWCMV65.WCM_ANLY:
LINE/COL ERROR
-------- ---------------------------------------------------------------------------------------------
2/15 PLS-00103: Encountered the symbol "CHNLDOC" when expecting one of the following:
2 begin
2 analyze table chnldoc compute statistics;
3 analyze index IDX_CHNLdoc_1 compute statistics;
4 analyze index IDX_CHNLdoc_2 compute statistics;
5 analyze table document compute statistics;
6 analyze index IDX_DOC_1 compute statistics;
7 analyze table dockeyword compute statistics;
8 analyze index IDX_DOCKEYWORD_1 compute statistics;
9 end;
10 /
Warning: Procedure created with compilation errors
SQL> show error
Errors for PROCEDURE TRSWCMV65.WCM_ANLY:
LINE/COL ERROR
-------- ---------------------------------------------------------------------------------------------
2/15 PLS-00103: Encountered the symbol "CHNLDOC" when expecting one of the following:
如果是10g或以上用dbms_stat这个包去分析表咯
create or replace procedure wcm_anly as
vs_sql varchar2(100) := 'analyze table chnldoc compute statistics';
..
begin
execute immediate vs_sql;
end;
/