I am trying to add the following stored procedure to my sql
BEGIN
declare user varchar(30);
declare amount_sent float(10,2);
declare balance float(10,2);
INSERT INTO transaction_response (ResultCode,ResultDesc,OriginatorID,TransactionID)
VALUES (ResultCode,ResultDesc,OriginatorID,TransactionID);
IF ROW_COUNT() > 0 THEN
select user_username into user from send_transaction where OriginatorID = OriginatorID;
IF FOUND_ROWS() > 0 THEN
select amount_in_usd into amount_sent from send_transaction where OriginatorID = OriginatorID;
IF FOUND_ROWS() > 0 THEN
select user_balance into balance from api_users where api_username = user;
IF FOUND_ROWS() > 0 THEN
UPDATE api_users SET user_balance=user_balance-amount_sent where api_username = user;
IF ROW_COUNT() = 1 THEN
SET statusout = '0000';
ELSE
SET statusout = '0001';
END IF;
ELSE
SET statusout = '0002';
END IF;
ELSE
SET statusout = '0003';
END IF;
ELSE
SET status = '0004';
END IF;
ELSE
SET status = '0005';
END IF;
END
Every time I try to add the procedure I get the following error message. I have tried to debug the statement, but I still cant find what is generating the error
One or more errors occured while processing your request.