# Empty set error

**URL:** <https://forums.percona.com/t/empty-set-error/1412>\
**Category:** Other MySQL® Questions\
**Created:** [May 19, 2010, 11:47pm UTC](https://forums.percona.com/t/empty-set-error/1412 "2010-05-19T23:47:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slamdunk](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@slamdunk](https://forums.percona.com/u/slamdunk)\
**Post date:** [May 19, 2010, 11:47pm UTC](https://forums.percona.com/t/empty-set-error/1412/1 "2010-05-19T23:47:27Z")

</div>

Guys,

I can run an update query from command line and it updates records but if I’m running same query from a procedure it returns empty set. Any idea why? The update query is below.

1. Create function Age

2. Update table set column1 = Age(column2)

3. CREATE DEFINER = ‘root’&#64;‘localhost’ PROCEDURE `Age_new`()  
NOT DETERMINISTIC  
MODIFIES SQL DATA  
SQL SECURITY DEFINER  
COMMENT ‘’  
BEGIN  
Update Related Set Age = Age(column2);  
END;

4. call Age\_new

---

<div class="post-metadata">

**Author:** ![morgo](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/morgo/32/752_2.png) [@morgo](https://forums.percona.com/u/morgo)\
**Post date:** [May 20, 2010, 1:17pm UTC](https://forums.percona.com/t/empty-set-error/1412/2 "2010-05-20T13:17:11Z")

</div>

The procedure itself can possibly execute many queries – all which affect rows.

Rather than give you the sum of affected rows, mysql just tells you no rows were affected.
