MySQL Syntax Error In Variable Declaration

后端 未结 1 1023
慢半拍i
慢半拍i 2021-01-18 11:02

I have the following MySQL query:

DELIMITER //
CREATE PROCEDURE InsertResult (IN winnerID INT, IN loserID INT)
BEGIN
    INSERT INTO KomperResult (WinnerID,          


        
1条回答
  •  北恋
    北恋 (楼主)
    2021-01-18 11:39

    DECLAREs need to go on the first line of your procedure.

    From the docs:

    DECLARE is permitted only inside a BEGIN ... END compound statement and must be at its start, before any other statements.

    0 讨论(0)
提交回复
热议问题