php - Why isn't my procedure in MySQL working -
so have procedure written in mysql, can tell me why isn't working?
create procedure add_order( in custid int, in productid int, in storeid int, in empid int, in quantity int, in r_payment char(10), in date date) begin insert orders(custid, empid, storeid, orderdate) values (in_cust, in_empid, in_storeid, in_date); insert order_product(orderid, productid, quantity, registerpayment) values (in_orderid, in_productid, in_quantity, in_r_payment); end this error message:
you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'end' @ line 1
drop procedure if exists `add_order`; delimiter $$ create procedure `add_order`( in custid int, in productid int, in storeid int, in empid int, in quantity int, in r_payment char(10),in date date ) begin insert orders(custid, empid, storeid, orderdate) values (in_cust,in_empid, in_storeid, in_date); insert order_product(orderid, productid, quantity, registerpayment) values (in_orderid, in_productid, in_quantity, in_r_payment); end $$ delimiter ; reference: https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-stored-procedures.html
you can use tool: http://tools.knowledgewalls.com/mysqlcreateprocedure
good luck!
Comments
Post a Comment