Error #1064 in CREATE PROCEDURE - Phpmyadmin SQL

Asked

Viewed 171 times

1

Message from Phpmyadmin:

Mensagens do MySQL : Documentação
1064 - Você tem um erro de sintaxe no seu SQL próximo a '@NumeroSerie INT(11),
        @Velocidade TINYINT(4),
        @Direcao SMALLINT(6),
        @Latit' na linha 2

Code that is in error:

CREATE PROCEDURE SpRegistraMsgPosicionamento(
    @NumeroSerie INT(11),
    @Velocidade TINYINT(4),
    @Direcao SMALLINT(6),
    @Latitude DECIMAL(8,4),
    @Longitude DECIMAL(8,4)
)
AS BEGIN 
    INSERT INTO posicionamento(EquipamentoId, Velocidade, Direcao, Latitude, Longitude) 
    VALUES (@NumeroSerie, @Velocidade, @Direcao, @Latitude, @Longitude)
END

2 answers

1


After I hit my head with it I realized I missed putting the IN

CREATE PROCEDURE `SpRegistraMsgPosicionamento`(
    IN `@NumeroSerie` INT, 
    IN `@Velocidade` TINYINT, 
    IN `@Direcao` SMALLINT, 
    IN `@Latitude` DECIMAL(8,4), 
    IN `@Longitude` DECIMAL(8,4)
)

0

See if it solves (I took from here):

Error 1064 occurs due to Mysql version incompatibility. Different versions have different reserved words, which, if are used by a previous version, cause the error.

The simplest and most effective solution to this is the following: when using phpMyadmin (accessible from your Control Panel), select the "compatibility mode" and select the version of the database in menu. That’s it! You should not get the same error again.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.