By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

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

P: 2
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
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,364
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

P: 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.