Page 1 of 1

Error with SQL script from within Visual Studio 2005 IDE

Posted: Wed 19 Apr 2006 18:57
by kevink
If I execute this command in a sql file connecting to mysql:
delimiter //

I get this error in the output window for
Core Lab Database Developer Tools:

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 //

This command works fine for MySQL 5 in any other context.

I am using Visual Studio 2005 Professional Edition,
MySQLDirect .NET Data Provider Professional version 3.50.10,
and MySQL Developer Tools version 1.70.28.

Must have to do with delimiter being mysql client command and not a sql statement

Posted: Wed 19 Apr 2006 19:13
by kevink
If this is because "delimiter" is mysql client command then how would one execute a CREATE PROCEDURE that includes semicolons from within VS 2005 IDE. Is there some equivalent to allow for semicolons within a sql statement.

Success!

Posted: Wed 19 Apr 2006 19:26
by kevink
CREATE PROCEDURE executes correctly from within the IDE when the delimiter command is simply left out.

Posted: Thu 20 Apr 2006 08:29
by Serious
To execute SQL which contains compound statements you should add '/' char to the end of SQL.
Example:

Code: Select all

create procedure in_out_inout_params(in in_param int, out out_param int, inout inout_param int)
begin
  set out_param = in_param * 4;
  set inout_param = inout_param * 2;
end
/