I'm trying to create a procedure, it worked an hour ago and now it's throwing an error. I exported the procedure(copied a text statement phpmyadmin output for me) and it wont let me execute the code I exported. The exported code is below followed by the error report phpmyadmin is displaying.
Also, all the sql queries work on their own but when the procedure was being called before I exported it, it was running but the queries were not affecting any rows. Am I labeling the variables wrong or something?(I don't think I am, I did check)
What I entered:
CREATE DEFINER=`root`@`localhost` PROCEDURE `DeleteCard`(IN `@aName` VARCHAR(255))
NO SQL
BEGIN
UPDATE Decks
JOIN Amount ON amount.DeckName = decks.DeckName
SET decks.DeckTotal = Decks.DeckTotal - Decks.DeckTotal
WHERE Amount.AmountName = @aName;
UPDATE Types t1
JOIN Cards ON cards.TypeName = t1.TypeName
JOIN Amount ON amount.CardName = Cards.CardName
SET t1.TypeTotal = t1.TypeTotal - Amount.Amount
WHERE Amount.CardName = @aName;
DELETE
FROM Amount
WHERE CardName = @aName;
DELETE
FROM Cards
WHERE CardName = aName;
END
Error report:
CREATE DEFINER=`root`@`localhost` PROCEDURE `DeleteCard`(IN `aName` VARCHAR(255))
NO SQL
BEGIN
UPDATE Decks
JOIN Amount ON amount.DeckName = decks.DeckName
SET decks.DeckTotal = Decks.DeckTotal - Decks.DeckTotal
WHERE Amount.AmountName = aName;
MySQL said: Documentation