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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -