using EXECUTE IMMEDIATE to run DBMS_STATS.GATHER_SCHEMA_STATS



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
.



Relevant Pages

  • Re: Execute Immediate with variable qty bind params
    ... I'm using Oracle 10gR2. ... cannot supply a fixed bind parameter list to the execute immediate ... pSTO_HEADLINE IN VARCHAR2 DEFAULT NULL, ... using a redundant select of the current value of the sequence. ...
    (comp.databases.oracle.server)
  • Re: I cant schedule more than one jobs with Oracle Scheduler
    ... What do you mean by "Note execute immediate mandatory" as shown below? ... Is it possible at all to schedule more than 1 jobs with Oracle ...
    (comp.databases.oracle.server)
  • Re: I cant schedule more than one jobs with Oracle Scheduler
    ... What do you mean by "Note execute immediate mandatory" as shown below? ... Is it possible at all to schedule more than 1 jobs with Oracle ...
    (comp.databases.oracle.server)
  • Re: problem with pl/sql
    ... ORA-00900: invalid SQL statement ... [Error Code: 900] ... [SQL State: 42000] ... It sure wasn't from any Oracle related document. ...
    (comp.databases.oracle.misc)
  • Re: Running a SQL script from a procedure!
    ... i am right now using oracle 9i. ... which i am using to create a .sql file using the UTL_FILE package.that ... Isn't there execute immediate? ... Just put the entire procedure text in a string. ...
    (comp.databases.oracle.server)