Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- DROP PROCEDURE IF EXISTS SEND_ITEMS;
- DELIMITER |
- CREATE PROCEDURE SEND_ITEMS(
- IN i_item_id int(11),
- IN i_customer_id VARCHAR(11),
- IN i_quantity SMALLINT)
- 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 IF;
- END
- |
- DELIMITER ;
Add Comment
Please, Sign In to add comment