mysql - Stored Procedure - Error #1064 -
getting error during creating stored procedure callable statement: know thing simple going wrong, i'm unable figure out!
my query:
use demo;
1. create procedure 2. insert_emp_data (in id int, in name varchar(2), in age int, in image blob) 3. begin 4. insert emp_data values(id, name, age, image); 5. end; /
sql query:
create procedure insert_emp_data (in id int, in name varchar(2), in age int, in image blob) begin insert emp_data values(id, name, age, image); mysql said: documentation #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 4
appreciate help! thank time!
when write stored procedure in mysql, should use delimiter
statement. in addition, should name columns not conflict column names. and, when using insert
list columns name. so:
delimiter $$ create procedure insert_emp_data ( in in_id int, in in_name varchar(2), in in_age int, in in_image blob ) begin insert emp_data(id, name, age, image) values(in_id, in_name, in_age, in_image); end; $$ delimiter ;
Comments
Post a Comment