
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Declare syntax error in MySQL Workbench?
The DECLARE syntax must between BEGIN and END. The syntax is as follows −
BEGIN DECLARE yourVariableName1 dataType, DECLARE yourVariableName2 dataType, . . . . END
Here is the query to avoid DECLARE syntax error in MySQL −
mysql> DELIMITER // mysql> create procedure declare_Demo() -> BEGIN -> DECLARE Name varchar(100); -> SET Name: ='John'; -> SELECT Name; -> END -> // Query OK, 0 rows affected (0.17 sec) mysql> DELIMITER ;
Call the stored procedure with the help of CALL command. The syntax is as follows −
CALL yourStoredProcedureName();
The query is as follows −
mysql> call declare_Demo();
The following is the output −
+------+ | Name | +------+ | John | +------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.01 sec)
- Related Articles
- Resolve MySQL ERROR 1064 (42000): You have an error in your syntax?
- Resolve Syntax error near “ORDER BY order DESC” in MySQL?
- Fix MySQL Error #1064 - You have an error in your SQL syntax… near 'TYPE=MyISAM?
- MySQL syntax error (in SELECT query) while using ‘group’ as table name
- Fix Error in MySQL syntax while creating a table column with name “index”?
- Performance Report Controls in Mysql Workbench
- How to resolve the MySQL error “You have an error in your SQL syntax; check the manual\nthat corresponds to your MySQL server version for the right syntax to use near?”
- How to fix error “You have an error in your syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near… ”?
- What is the MySQL syntax error in this query – Creating a table with reserved keyword?
- Getting a syntax error unknown fields in SAP ABAP
- What do column flags mean in MySQL Workbench?
- Resolve usage of quotes ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use?
- How to take MySQL database backup using MySQL Workbench?
- ERROR 1064 (42000): You have an error in your SQL syntax at zero fill column?
- Create a new database with MySQL Workbench?

Advertisements