Toad for Data Analysts used with Oracle, can't run gather statistics

I am connected to an Oracle database, user=WFPDMHM, schema=WFPDMHM. I am running this command

exec dbms_stats.gather_table_stats(ownname=>‘WFPDMHM’,tabname=>‘hpt_cmpn_exclude_rsn_hist’,estimate_percent=>‘10’,CASCADE=>TRUE,DEGREE=>8);

It returns this error:

Category Timestamp Duration Message Line Position Parser Messages 2/12/2015 10:26:56 AM line 29, col 1: Incorrect syntax near ‘dbms_stats’

Running the exact same command in Oracle SQL Developer 3.2.9 works just fine.

Explanations and suggestions will be greatly appreciated, but upgrading is not a viable option.

  • Toad for Data Analysts, 2.6.1.568, license is good
  • ToadCore Plug In ver 4.6.1.568
  • ToadOracle Plug In ver. 4.6.0.568
  • ToadOracle Provider Plug In ver 4.6.0.568
  • ToadPlugin Plug In ver 4.6.0.568

You’re in the Toad for Oracle forum, not TDA, but I’ll take a stab at the answer anyway…

try it like this instead:

begin

dbms_stats.gather_table_stats (ownname=>‘WFPDMHM’,tabname=>‘hpt_cmpn_exclude_rsn_hist’,estimate_percent=>‘10’,CASCADE=>TRUE,DEGREE=>8);

end;

Thanks for the quick reply. I’m posting in this forum thinking it might be more of an Oracle issue.

This Toad for Data Analysts I’m using (renamed a few years ago as Toad Data Point) can’t run PL/SQL constructs like begin–end in the SQL editor window. That would certainly simplify my life.