- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
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)
- 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?
- Getting a syntax error unknown fields in SAP ABAP
- MySQL syntax error (in SELECT query) while using ‘group’ as table name
- Create a new database with MySQL Workbench?
- Create a stored Procedures using MySQL Workbench?
- What do column flags mean in MySQL Workbench?
- How to take MySQL database backup using MySQL Workbench?
- Fix Error in MySQL syntax while creating a table column with name “index”?
- ERROR 1064 (42000): You have an error in your SQL syntax at zero fill column?
- How to resolve the MySQL error “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?”
- How to keep the connection alive in MySQL Workbench?
- What is the MySQL syntax error in this query – Creating a table with reserved keyword?
- 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?