ramesh

ramesh

  • NA
  • 19
  • 46.9k

while execute the stored procedure it shows the following error?

Aug 24 2012 2:02 AM
create or replace procedure insert_state1(p_country_id in state.countryid%type, p_state_name in state.statename%type) is
 v_countryname varchar2(20);
 begin
 select countryname into v_countryname from country where countryid=p_country_id;
 insert into state(countryid, countryname, statename) values(p_country_id,v_countryname,p_state_name);
 end;
/
Procedure created.

SQL> exec insert_state1(10,'ap');
BEGIN insert_state1(10,'ap'); END;

*
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "SCOTT.INSERT_STATE1", line 4
ORA-06512: at line 1

where is error and how to execute?

Answers (3)