Stored Procedure MySql
Posted on 2007-10-08
I have a table called 'capital' in mysql. I am subtracting 10 from a field called 'pendingCapitalAvailable'. To accomplish this, I am considering using a called procedure that I will call from Matlab. I need to make sure the table is locked until I finish the procedure.
Below is the code I wrote to create the procedure, it does not work and tells me to look at the manual to figure it out. Can you tell me what is wrong with it?
create procedure lockedUpdateOfCapital(IN capitalUsed INT)
UPDATE capital SET pendingCapitalAvailable = pendingCapitalAvailable - capitalUsed;
UPDATE capital SET marginAvailable = marginAvailable - capitalUsed;
I assume to execute it I would type 'call lockedUpdateOfCapital(102)' in the query browser. Where can I find a list of the stored procedures?
MySQL 5.0.45-community-nt via TCP/IP
MySQL Client Version 5.1.11
InnoDB tables but I could use MYISAM tables if necessary