y Posted February 12, 2012 Share Posted February 12, 2012 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 Quote Link to comment Share on other sites More sharing options...
fenway Posted February 12, 2012 Share Posted February 12, 2012 Show us the actual procedure that was created -- as mysql has it stored. Quote Link to comment Share on other sites More sharing options...
mikosiko Posted February 13, 2012 Share Posted February 13, 2012 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 Quote Link to comment Share on other sites More sharing options...
fenway Posted February 13, 2012 Share Posted February 13, 2012 No, that's what you type. Show us the procedure that is stored in the database. Quote Link to comment Share on other sites More sharing options...
y Posted February 16, 2012 Author Share Posted February 16, 2012 thnx sorry i really was calling another procedure by mistake Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.