Итак, у меня есть эта процедура написана на MySQL, кто-нибудь может сказать мне, почему она не работает?
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 into Orders(custid, empid, storeid, orderdate) values (IN_cust, IN_empid, IN_storeid, IN_date);
insert into Order_Product(orderid, productid, quantity, RegisterPayment) values (IN_orderid, IN_productid, IN_quantity, IN_R_payment);
end
Это сообщение об ошибке:
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'end' at 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 INTO Orders(custid, empid, storeid, orderdate) values (IN_cust,IN_empid, IN_storeid, IN_date);
INSERT INTO Order_Product(orderid, productid, quantity, RegisterPayment) values (IN_orderid, IN_productid, IN_quantity, IN_R_payment);
END
$$
DELIMITER ;
Ссылка:
https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-stored-procedures.html
Вы также можете использовать этот инструмент:
http://tools.knowledgewalls.com/mysqlcreateprocedure
Удачи!
использовать DELIMITER //
DELIMITER $$
DROP PROCEDURE IF EXISTS `add_Order` $$
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 into Orders(custid, empid, storeid, orderdate) values (IN_cust,
IN_empid, IN_storeid, IN_date);
insert into Order_Product(orderid, productid, quantity, RegisterPayment)
values (IN_orderid, IN_productid, IN_quantity, IN_R_payment);
end $$
DELIMITER ;