TZStoredProcedure and MySQL 5.1.7-beta

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Burzum
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 12.04.2006, 13:51
Contact:

TZStoredProcedure and MySQL 5.1.7-beta

Post by Burzum »

I have problem with a calling stored procedure in MySQL base. I getting "Unsupported operation" exception on SP.ExecSQL. Do someone know why?


Delphi 7:
var
new: TZStoredProc;
begin
new:=TZStoredProc.Create(nil);
new.Connection:=DM.zMain;
new.StoredProcName:='KalRasFullMonth';
new.Params.CreateParam(ftDate,'d',ptInput);
new.Params[0].Value:=StrToDate('01.01.2006');
new.ExecProc;
end;

MySQL:
CREATE PROCEDURE KalRasFullMonth (d DATE)
BEGIN
DECLARE i INT;
DECLARE Cnt INT;
SET i=0;
WHILE MONTH(d)=MONTH(d+i) DO
IF (SELECT COUNT(*)
FROM kalendarrashodov
WHERE Today=d+i AND NalBeznal=0)<1
THEN
INSERT INTO KalendarRashodov(Today, NalBeznal)
VALUES(d+i, 0);
END IF;
IF (SELECT COUNT(*)
FROM kalendarrashodov
WHERE Today=d+i AND NalBeznal=1)<1
THEN
INSERT INTO KalendarRashodov(Today, NalBeznal)
VALUES(d+i, 1);
END IF;

SET i=i+1;
END WHILE;
END


PS. Sorry for my bad english...
Post Reply