468,541 Members | 1,740 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,541 developers. It's quick & easy.

Trigger & error #1329 No data - zero rows fetched, selected, or processed

Hi
I've a problem with trigger
Expand|Select|Wrap|Line Numbers
  1. CREATE TRIGGER `jos_vm_shopper_group_after_upd_tr` AFTER UPDATE ON `jos_vm_shopper_group` FOR EACH ROW
  2. BEGIN
  3. DECLARE orgPrice DECIMAL(9,5);
  4.      DECLARE newPrice DECIMAL(9,5);
  5.      DECLARE proId int;
  6.      DECLARE cur CURSOR FOR SELECT product_price,product_Id FROM jos_vm_product_price as t1 WHERE shopper_group_id=5;
  7.  
  8.  
  9. IF (NEW.shopper_group_id=6) THEN
  10. OPEN cur;
  11.      LOOP
  12.      FETCH cur INTO orgPrice,proId;
  13.      SET newPrice=((orgPrice*100)/(100-NEW.shopper_group_discount));
  14.  
  15.      UPDATE jos_vm_product_price AS t3 SET product_price=newPrice WHERE shopper_group_id=6 AND t3.product_id=proId;
  16.  
  17.      END LOOP;
  18.      CLOSE cur;
  19. END IF;
  20. END
trigger works but i get an error #1329 - No data - zero rows fetched, selected, or processed

Can someone help me?

MySQL v.5.1.54
May 31 '12 #1
2 3856
Rabbit
12,513 Expert Mod 8TB
If there's an error, then it's not working right?

Is your cursor supposed to use shopper group id 5 while the rest uses 6?
May 31 '12 #2
@Rabbit
ad1. Despite the fact it is a error UPDATE performed correctly
ad2. cursor takes the old price, rest update new price for other group
Jun 1 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by yoohanman | last post: by
5 posts views Thread by Bruno Rafael Moreira de Barros | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.