Home » SQL & PL/SQL » SQL & PL/SQL » Analyzing within a block (9.2.0.7)
Analyzing within a block [message #355173] Thu, 23 October 2008 00:35 Go to next message
nazbrian
Messages: 36
Registered: July 2008
Member
Hi,


SQL> analyze table JTF_IH_BULK_QTBL compute statistics;

Table analyzed.

SQL> begin
  2  analyze table JTF_IH_BULK_QTBL compute statistics;
  3  end;
  4  /
analyze table JTF_IH_BULK_QTBL compute statistics;
        *
ERROR at line 2:
ORA-06550: line 2, column 9:
PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
:= . ( @ % ;


SQL> 


In the above , what is the reason ANALYZE is not working within BEGIN..END; Is it because its DDL.

I understand that, in 9i I'll have to use dbms_stats.GATHER_TABLE_STATS.

Brian.
Re: Analyzing within a block [message #355180 is a reply to message #355173] Thu, 23 October 2008 00:41 Go to previous messageGo to next message
nazbrian
Messages: 36
Registered: July 2008
Member
Hi,

Its working within EXECUTE IMMEDIATE.

thanks
Brian
Re: Analyzing within a block [message #355181 is a reply to message #355173] Thu, 23 October 2008 00:41 Go to previous message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Is it because its DDL.

Yes, search for "execute immediate".

Regards
Michel
Previous Topic: ORA-02046: distributed transaction already begun
Next Topic: Query to find number of working days in a month
Goto Forum:
  


Current Time: Mon Dec 05 15:20:17 CST 2016

Total time taken to generate the page: 0.05570 seconds