Problem running MySQL script with StoreProc

Got a problem you cannot solve? Try here.
Post Reply
alemieux
Posts: 8
Joined: Thu May 06, 2010 9:02 pm

Problem running MySQL script with StoreProc

Post by alemieux »

Hi,

I am currently evaluating different product to automate our windows installer build for our product. So far, it does almost everything we need and the IDE makes it very easy to achieve that. Unfortunately, there is one thing I didn't figured out yet.... is running my MySQL scripts that creates Stored Procedure (Routine) with the provided MySQL plugin bundled in InstallAware 9 (Build Moya.sp1.070409).


Here is shorter version of my script that works when executed from MySQL Query Browser but not from inside InstallAware MySQL plugin :

Code: Select all

USE myDb;

DELIMITER //

DROP PROCEDURE IF EXISTS `DropFK`//

CREATE PROCEDURE `DropFK`(IN fk VARCHAR(100), IN tbl VARCHAR(100))
BEGIN
IF EXISTS (SELECT NULL FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE CONSTRAINT_SCHEMA = DATABASE() AND CONSTRAINT_NAME = fk) THEN
  SET @s = concat("ALTER TABLE ",tbl," DROP FOREIGN KEY ", fk);
  PREPARE stmt FROM @s;
  EXECUTE stmt;
  DEALLOCATE PREPARE stmt;
END IF;
END//
DELIMITER ;
I run the script with the option "Abort execution on script error" enabled... and the result return from the plugin into my Variable is "ERROR". What is strange is that ... according to the "What's new" from the help file inside the IDE, I am supposed to get the actual SQL statement that make it crash as a second part and I am only receiving "ERROR". (I might not fully understand how to capture it... but what I see in my variable is only that string.)

All other scripts that do normal statement and doesn't requires modifying the MySQL default DELIMITER from ; to something else like // works fine.

Is this something the plugin doesn't support? Or do I need to create my store proc differently / workaround ?

Thanks in advance,

Antoine
alemieux
Posts: 8
Joined: Thu May 06, 2010 9:02 pm

Re: Problem running MySQL script with StoreProc

Post by alemieux »

To simplify the test case, you can only try to run the follwing SQL script :

Code: Select all

DELIMITER //
Thanks
Antoine
alemieux
Posts: 8
Joined: Thu May 06, 2010 9:02 pm

Re: Problem running MySQL script with StoreProc

Post by alemieux »

Anyone?
Post Reply