MySQL Forums
Forum List  »  Stored Procedures

Declare statement causing error 1064
Posted by: Rinaldo Clucher
Date: November 25, 2018 06:12AM

Hi Folks,

I have installed 8.0.13 MySQL Community Server - GPL
I have been trying to create the simplest stored procedure with a Declare variable but am getting a 1064 error when I add the declare variable. I am also getting the same error when entering the same same sql in the CLI using delimiters. Can someone tell me what I am doing wrong? The reference suggest this syntax should be correct.

SQL:

use RCData;
drop procedure if exists UpdateProductConfiguration;
CREATE PROCEDURE UpdateProductConfiguration()
BEGIN
declare v_pcid varchar(20);
END;

ERROR:

CREATE PROCEDURE UpdateProductConfiguration () BEGIN DECLARE v_pcid VARCHAR(20) Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4 0.015 sec

Options: ReplyQuote


Subject
Views
Written By
Posted
Declare statement causing error 1064
78
November 25, 2018 06:12AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.