Re: using EXECUTE IMMEDIATE to run DBMS_STATS.GATHER_SCHEMA_STATS

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 31 Oct 2008 17:37:47 +0100
Message-ID: <490b345a$0$14097$426a74cc@news.free.fr>

"Kevin S" <SearleK_at_googlemail.com> a écrit dans le message de news: c285fc93-2f58-4acb-b9e3-083caa86d366_at_w39g2000prb.googlegroups.com...
| When I run the block below, in oracle 10.2.0.3.0, I get the error
| shown after. Is this a problem with my coding or is it just not
| possible to run this commad in pl/sql?
|
| Thanks
|
| DECLARE
| v_dbms_stats VARCHAR2(200):= 'EXEC
| DBMS_STATS.GATHER_SCHEMA_STATS( ownname => ''LOAD'',
| estimate_percent => 100, cascade => TRUE,options => ''GATHER
| AUTO'');';
| BEGIN
| EXECUTE IMMEDIATE v_dbms_stats;
| END;
|
|
| ERROR at line 1:
| ORA-00900: invalid SQL statement
| ORA-06512: at line 4

Also EXEC is a SQL*Plus command not a PL/SQL one.

Regards
Michel Received on Fri Oct 31 2008 - 11:37:47 CDT

Original text of this message