Re: Can't send SQL statement containing 'DELIMITER $$'
Posted by: Denis Lemberger
Date: May 02, 2012 12:11AM

Dear Mark

Many thanx for your quick answer!

Now as I mentioned, there is a whole script to be executed via JDBC, which may contain a 'create function' statement. Here is an example:

------------------
drop function if exists test;

delimiter $$

create
definer = 'root'@'localhost'
function `test`(nr INT)
returns text charset utf8
deterministic
sql security invoker
begin
return concat("<", nr, ">");
end$$

delimiter ;
------------------

This script works fine when executed in the workbench but fails when executed in the java environment, even when the 'delimiter' command is not present. I understand that the 'delimiter' command can't work when using JDBC as it is a mySQL command line client keyword. But then how can I execute such a script from JDBC?

BTW: This 'drop' statement above is just an example. There might be a bunch of other statements (alter table, create or replace view, insert, update, delete, etc.) instead.

Best regards
:-Denis

Options: ReplyQuote


Subject
Written By
Posted
Re: Can't send SQL statement containing 'DELIMITER $$'
May 02, 2012 12:11AM


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.