lol.. I love that song!
The truth is that I have changed this so many times that I don't know which way is up. It really IS the whole code and not a watered down version.
Here is the current version though..
Code:
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;
DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;
DECLARE EXIT HANDLER FOR NOT FOUND ROLLBACK;
SET row = '0';
START TRANSACTION;
UPDATE user
SET name = inName
WHERE code = inCode;
COMMIT;
SET row = '1';
END
I have another proc that inserts and uses the exact same syntax and it works great. This update won't though and I can't seem to find the problem.
I ran just the straight DDL in a command window with a bad 'inCode' expecting to get an error but nothing happens. What I mean by this is that when I press enter in the command utility window, the DDL is submitted and I don't get an error of any kind. If I do a row_count I get back -1 which means the query failed.
I believe that when there is no match for the inCode that there will be nothing to rollback. This I understand but I need to have either a zero or one returned back out.
What I mean when I say that I need the affected rows returned out is that if a row has been successfully altered, I would like to have my OUT parameter tell me this by either a zero or a one. One for success and zero for fail.