ORA-00900: invalid SQL statement- when run a procedure in oracle 10g

kumar picture kumar · Dec 5, 2012 · Viewed 79.9k times · Source

I am using Oracle 10g database and trying to run a procedure using SQL commands.

create or replace procedure "exam" is
begin
  DBMS_OUTPUT.PUT_LINE('Test');
end;

Then click on Run button. It shows: "procedure created".

When I try to execute it using:

execute exam;

then click on Run button, it shows:

ORA-00900: invalid SQL statement

Thanks for your help.

Answer

Kirill Leontev picture Kirill Leontev · Dec 5, 2012

Just noticed a detail in your question. You press run button. Thus, you must be using an IDE.

You cannot use execute in IDEs - it is an sql*plus command. It might work in Oracle SQL Developer though, but I wouldn't use it there anyway;

Try

begin
  exam;
end;