0
I am trying to create a precedent that changes between Insert and update in phpmyadmin but returns me an error in the line of if EXISTS, then I tried to create by the graphical panel and returns me error in the last line always... Someone knows what’s wrong?
Error when I try the panel (No sql)
Query
CREATE PROCEDURE SEND_ITEMS(
IN i_item_id int(11),
IN i_customer_id VARCHAR(11),
IN i_quantity SMALLINT)
AS
BEGIN
IF(EXISTS(SELECT item_id,customer_id FROM wpcheap_items_selected WHERE (item_id = i_item_id AND customer_id = i_customer_id)))
THEN Update wpcheap_items_selected SET quantity = i_quantity WHERE (item_id = i_item_id AND customer_id = i_customer_id)
ELSE
INSERT INTO wpcheap_items_selected(item_id,customer_id,quantity) VALUES (i_item_id, i_customer_id, i_quantity)
END
Thank you very much It worked
– Anderson Henrique