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'@'localhost' PROCEDURE `Age_new`()
NOT DETERMINISTIC
MODIFIES SQL DATA
SQL SECURITY DEFINER
COMMENT ''
BEGIN
Update Related Set Age = Age(column2);
END;
Hi, Since I am learning to write procs in MySQL, I checked your code and with just modifications to columns in my test databases the code ran fine [MySQL 5.1.46 - under Vista]. If I ran as another user than root@localhost with minimal rights, i.e. only Execute it also ran fine.
The last weeks learning procs in MySQL, I have been known to forget to drop a procedure and thus been running the old version of procs...with similar - that is - no changes in records, but you're probably past that...
And I have also forgotten to set back autocommit=1 and had no COMMIT in the procs - many grey hair these last weeks.
Bookmarks