slamdunkrookie — 2010-05-20T01:09:34-04:00 — #1
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.
Create function Age
Update table set column1 = Age(column2)
CREATE DEFINER = 'root'@'localhost' PROCEDURE
MODIFIES SQL DATA
SQL SECURITY DEFINER
Update Related Set Age = Age(column2);
bagtjesen — 2010-05-20T18:07:56-04:00 — #2
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.
slamdunkrookie — 2010-05-20T02:55:06-04:00 — #3
Its MYSQL database and its a stored procedure in mysql.
This is not exactly an error. It doesnt update records when calling update command from a procedure.
spacephoenix — 2010-05-20T01:43:41-04:00 — #4
What language is the procedure, ie php, asp, etc?
What database server are you using, ie MySQL, MsSQL, etc?
What errors if any is the database server returning?
slamdunkrookie — 2010-05-20T19:09:53-04:00 — #5
It seems that empty set is just an information message. I didn't check the data so far. The proc does updates records.