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 Link to comment https://forums.phpfreaks.com/topic/256944-stored-procedure-erro/ 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. Link to comment https://forums.phpfreaks.com/topic/256944-stored-procedure-erro/#findComment-1317266 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 Link to comment https://forums.phpfreaks.com/topic/256944-stored-procedure-erro/#findComment-1317393 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. Link to comment https://forums.phpfreaks.com/topic/256944-stored-procedure-erro/#findComment-1317708 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 Link to comment https://forums.phpfreaks.com/topic/256944-stored-procedure-erro/#findComment-1318040 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.