MySQL Forums
Forum List  »  Connector/JDBC and Java

Can't send SQL statement containing 'DELIMITER $$'
Posted by: Denis Lemberger
Date: May 01, 2012 01:58AM

Hello all

When I send via java.sql.Connection an SQL string that contains the 'DELIMITER' statement (e.g. when I want to create a stored procedure), I get the exception:

"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 'DELIMITER $$ (...)"

When I omit this 'DELIMITER' statement, I get the exception:

"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 '; CREATE (...)"

I found out that it works fine when I *isolate* the CREATE statement (with no other statements before or after), but that's not what I need, because I must execute an sql script that contains many statements, the CREATE statement among them.

Any ideas how I can accomplish this?

Many thanx in advance
:-Denis

Options: ReplyQuote


Subject
Written By
Posted
Can't send SQL statement containing 'DELIMITER $$'
May 01, 2012 01:58AM


Sorry, you can't reply to this topic. It has been closed.

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.