TMySctipt, Delimiter problem once more.

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m227
Posts: 75
Joined: Mon 06 Aug 2007 12:41

TMySctipt, Delimiter problem once more.

Post by m227 » Sun 05 Jun 2011 13:36

Please tell me how to format script like below to be executed without error in TMyScript component.

Code: Select all

DROP PROCEDURE IF EXISTS Raport23$$
CREATE PROCEDURE Raport23(pr  INT)
COMMENT 'karta pracy produktu'
READS SQL DATA
BEGIN
  SELECT * FROM Operation;
END$$
CALL CacheListReports()$$
I setup also TMyScript.Delilmiter property to $$ with no effect.
I also tried to add explicitly command DELIMITER $$ at start with no change.

Michal, Poland

m227
Posts: 75
Joined: Mon 06 Aug 2007 12:41

Bug found

Post by m227 » Sun 05 Jun 2011 13:51

I found that when i put SPACE before my delimiter ($$) it works, however in original SQL it is not necessary. Below is a working code.

Code: Select all

DELIMITER $$
DROP PROCEDURE IF EXISTS Raport23 $$
CREATE PROCEDURE Raport23(pr  INT)
COMMENT 'karta pracy produktu'
READS SQL DATA
BEGIN
  SELECT * FROM  Operation;
END $$
CALL CacheListReports() $$
DELIMITER ;

AndreyZ

Post by AndreyZ » Mon 06 Jun 2011 12:15

Hello,

In the latest MyDAC version (6.10.0.7), you can execute the following script without putting the space character before your delimiter:

Code: Select all

DELIMITER $$
DROP PROCEDURE IF EXISTS Raport23$$
CREATE PROCEDURE Raport23(pr  INT)
COMMENT 'karta pracy produktu'
READS SQL DATA
BEGIN
  SELECT * FROM  Operation;
END$$
CALL CacheListReports()$$
DELIMITER ;

Post Reply