Jump to content

stored procedure erro ?


y

Recommended Posts

hello falks

 

please i've done this procedure to insert into two related tables

 

create procedure sp_new_empdet
    -> (in p_name varchar(50),in p_address varchar(100),in p_phone varchar(20))
    -> begin 
    -> insert into emp(name) values(p_name);
    -> insert into emp_details(id,address,phone) values(last_insert_id(),p_address,p_phone);
    -> end;
    -> $$

 

the procedure created successfuly, but when i call it to add row like this

call sp_new_emp('y1','y1address','y1123');
    -> $$
ERROR 1318 (42000): Incorrect number of arguments for PROCEDURE db1.sp_new_emp; expected 1, got 3

 

please help me to correct the error in code

 

thnx

 

 

Link to comment
https://forums.phpfreaks.com/topic/256944-stored-procedure-erro/
Share on other sites

the procedure that you posted:

 

create procedure sp_new_empdet
    -> (in p_name varchar(50),in p_address varchar(100),in p_phone varchar(20))
....
....

 

the posted error:

ERROR 1318 (42000): Incorrect number of arguments for PROCEDURE db1.sp_new_emp; expected 1, got 3

 

is not the error clear?  ... sp_new_empdet != sp_new_emp

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.