#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
Posted by: Mike Kala
Date: February 26, 2022 07:51AM

Hello Team,
I did run my script in MySQL Workbench 8.0.26 to create a very simple procedure using MySQL Common Table Expression (CTE)
in my local database it is working fine.
The issue is when I run the same script in the Hosting server database ( Database client version: libmysql - mysqlnd 7.4.27 ), I am getting the following issue:
This is my script:
CREATE PROCEDURE assets()
BEGIN
WITH cte_assets AS ( SELECT * FROM assets )
SELECT id, assetnum, location FROM cte_assets;
END;
This is the issue :
MySQL said: Documentation
#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 'cte_assets AS ( SELECT * FROM assets )
SELECT id, assetnum, location FROM cte_' at line 3

Can you please help on this issue?
Thank you and have a great day

Options: ReplyQuote


Subject
Views
Written By
Posted
#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
424
February 26, 2022 07:51AM


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.