Page 1 of 1

Problem creating a stored procedure

Posted: Sat 18 Jun 2011 05:54
by aleigh2400
Hi,

I'm attempting to create a stored procedure using TMyScript and I get a 24000 error on the "FETCH reconciliationsCur INTO a;" line when it gets to this code...

OPEN reconciliationsCur;
my_loop:LOOP
FETCH reconciliationsCur INTO a;
IF done THEN
LEAVE my_loop;
END IF;

The script runs no problem when I execute it in phpMyAdmin or SQLyog. Why is it throwing an error here when this script runs fine elsewhere?

I'm using MyDAC version 6.10.0.8 and MySQL server version 5.1.56.

Thanks in advance for your help.

Regards,

Andrew

Posted: Mon 20 Jun 2011 08:53
by AndreyZ
Hello,

The point is that the TMyScript component interprets the ":LOOP" string as a parameter. To solve the problem, you should insert the space symbol between colon and the LOOP statement in the following way:

Code: Select all

OPEN reconciliationsCur; 
my_loop: LOOP 
FETCH reconciliationsCur INTO a; 
IF done THEN 
LEAVE my_loop; 
END IF;