- Код: Выделить всё
create procedure addToBasket(in userID int, in artID int, in artQnty double)
BEGIN
IF (select count(*) from b2b_basket where uid = UserID and artRef = artID) > 0 THEN
Update b2b_basket set qnty = qnty + artQnty where uid = UserID and artRef = artID;
ELSE
Insert into b2b_basket (uid, artRef, qnty, selected) values (UserID, artID, artQnty, 0);
END IF
END
сабж ругаеться на этот код
MySql писал(а):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 8