Help getting event to work
Posted by: Jan Klemmensen
Date: February 18, 2012 11:52AM
I am trying to create an event which deletes items in a cart more than 1 hour old, and at the same time updates to other tables. - I can see that the event is running, but nothing is being executed, can someone point out what is wrong?
Are the variables being declared wrongly perhaps?
ON SCHEDULE EVERY 5 MINUTE
DECLARE cartID INTEGER(11);
DECLARE cartProductID INTEGER (11);
DECLARE cartAntal INTEGER (11);
DECLARE cartStr VARCHAR(5);
SELECT id, produkt_id, antal, str INTO cartID, cartProductID, cartAntal, cartStr FROM cart WHERE added_date >= added_date + 10000 LIMIT 1 ;
UPDATE products SET stock = stock + cartAntal WHERE produkt_id = cartProductID;
UPDATE sizes SET antal = antal + cartAntal WHERE size = cartStr AND product_id = cartProductID;
DELETE FROM cart WHERE id = cartID;
Unfortunately nothing happens at all :-/
I hope somone can see what is wrong here!
Regards Jan Klemmensen
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.