views:

222

answers:

1

Good afternoon,

I am attempting to run a stored procedure that updates records in MySQL 5.1 on Mac OSX 10.4.11. Here is a sample procedure:

DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `TestUpd`()
BEGIN

    UPDATE Addr
    SET eMail2 = 'test';

END
$$

When I execute this procedure, I get the error, 'Error executing SQL command'. I've tried various options, but this is the simplest example that illustrates the problem.

This does not happen when I try the same thing in MySQL 5.1 on Windows XP.

Any ideas?

Thank you,

Igal

A: 

As a follow-up, we stumbled upon a workaround and will post it here for future reference.

When we added a select statement to the stored procedure after the UPDATE statement, the procedure worked as expected. This is not an optimal workaround since you will not be able to modify your procedures in all cases, but we are able to do so in our case. The following then worked for us:

DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `TestUpd`()
BEGIN

    UPDATE Addr
    SET eMail2 = 'test';

    SELECT 0;

END
$$