Error with SQL script from within Visual Studio 2005 IDE

Error with SQL script from within Visual Studio 2005 IDE

Postby kevink » Wed 19 Apr 2006 18:57

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.
kevink
 
Posts: 10
Joined: Tue 20 Dec 2005 18:30

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

Postby kevink » Wed 19 Apr 2006 19:13

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.
kevink
 
Posts: 10
Joined: Tue 20 Dec 2005 18:30

Success!

Postby kevink » Wed 19 Apr 2006 19:26

CREATE PROCEDURE executes correctly from within the IDE when the delimiter command is simply left out.
kevink
 
Posts: 10
Joined: Tue 20 Dec 2005 18:30

Postby Serious » Thu 20 Apr 2006 08:29

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


Return to dotConnect for MySQL