Problem with execute procedure in PL/SQL Developer

user572844 picture user572844 · Mar 5, 2011 · Viewed 42.9k times · Source

I this is my first attempt to create procedure and execute it. First I create simple table. DB scheme of table is here:

Table name: Ziaci

Columns:

  • ZiakId - primary key, number
  • Surname, varchar2
  • FirstName, varchar2
  • TriedaId - forgein key, number

Store procedure only insert data in table, I created store procudure with this SQL cmd:

create procedure ziaci_proc(surname_in in varchar2, 
firstname_in in varchar2, triedaid_in in number)
is
begin
  insert into ziaci (surname, firstname,triedaid) values (surname_in,firstname_in,triedaid_in);
  end;

And I try call this procudure as:

execute ziaci_proc('X','Y',1)

I get this error:

ORA-00900 invalid SQL statement

An in PL/SQL Developer IDE is with red color underlined execute word.

I test this procedure and it works good.

I can only execute this procedure with this SQL command:

begin
ziaci_proc('A','B',2);
end;

What is bad, thank for help.

Answer

javanna picture javanna · Mar 5, 2011

I think you're writing command in "SQL Window". You should use "Command Window" to succesfully execute this line:

execute ziaci_proc('X','Y',1);