2

While running dbms command

execute dbms_utility.analyze_schema('MCC','ESTIMATE',30);

I got ORA-00900: invalid SQL statement error.

Can anyone tell me what could be the reason?

Peter Lang
  • 54,264
  • 27
  • 148
  • 161
Sandeep Kumar
  • 13,799
  • 21
  • 74
  • 110
  • 3
    There is nothing wrong with your code. Where are you calling it? SQL*Plus? – Peter Lang Feb 27 '10 at 09:22
  • @Sandy: I have to concur with @Dougman. You've asked 18 questions and haven't accepted any of the answers you've received. This is important to some of us because it improves the answerer's reputation score. To accept an answer click on the check mark to the left of the answer - it'll change color to show which answer you've accepted. Thanks. – Bob Jarvis - Слава Україні Feb 28 '10 at 14:07

3 Answers3

5

The execute sentence is only for SQL*Plus utility.

To call a PLSQL statement from the most of applications/languages you have to try some of the following, It depends on where you are playing:

Option 1. Without /.

begin
  dbms_utility.analyze_schema('MCC','ESTIMATE',30);
end;

Option 2. With /

begin
  dbms_utility.analyze_schema('MCC','ESTIMATE',30);
end;
/
FerranB
  • 35,683
  • 18
  • 66
  • 85
0

You need to set the server output on before executing the procedure in SQL Developer. Kindly try below code:

SET SERVEROUTPUT ON;
execute dbms_utility.analyze_schema('MCC','ESTIMATE',30);

If you still get the same error then please open your SQL*PLUS and check if PLSQL is installed in it.

Piyush
  • 19
  • 4
-1

In Oracle 10g people face ORA-0900 Invalid SQL statement. Solution is try to execute stored procedure by placing the stored procedure between BEGIN and END keywords.

begin
    stored_procedure_name(parameter);
end;
Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134