Page 1 of 1

Unsupported operation

Posted: 24.10.2008, 21:30
by hgomez
[font=Tahoma]
Hello to everyone, I need some help to resolve a problem working with ZeosLib 6.6.3 stable.

I´m developing an application in Delphi 2007, executing a MySQL Stored Procedure but I got the following error message "Unsupported operation" when execute TZStoredProc.ExecProc method.

(* **************************************************** *)
(* I´m using a TZStoredProc with the following Stored Procedure: *)
(* **************************************************** *)

CREATE DEFINER=`root`@`localhost` PROCEDURE `spuInsertarMovimiento`(txnut int, txcod varchar(4))
BEGIN
insert tbl_movimiento values( txnut, txcod );
END

(* **************************************************** *)
(* My application code in Delphi 2007: *)
(* **************************************************** *)
var
spData: TZStoredProc;
dbConn: TZConnection;
begin
Result := DBR_ERROR;
try
dbConn := TZConnection.Create( Self );
try
dbConn.Connected := false;
dbConn.HostName := 'localhost';
dbConn.Port := 3306;
dbConn.Protocol := 'mysql';
dbConn.Catalog := 'visionamos';
dbConn.User := 'root';
dbConn.Password := 'xxxxxx';
dbConn.Connected := true;

spData := TZStoredProc.Create( Self );

try
spData.Connection := dbConn;
spData.StoredProcName := 'spuInsertarMovimiento';

spData.Params.Clear;
spData.Params.CreateParam( ftInteger, '0', ptInput );
spData.Params[ 0 ].Size := 0;
spData.Params[ 0 ].Value := 123456;

spData.Params.CreateParam( ftString, '1', ptInput );
spData.Params[ 1 ].Size := 4;
spData.Params[ 1 ].Value := 'CODE';

spData.ExecProc; // Right here is raised the message error

Result := DBR_SUCCESS;

finally
spData.Free;
end;

finally
dbConn.Connected := false;
dbConn.Free;
end;

except
on e: Exception do
begin
raise Exception.CreateFmt( 'ERROR: Executing (%s)', [ e.Message ] );
Result := DBR_ERROR;
end;
end;

P.D.
In my machine are installed Windows Vista Home Premium SP1 (Spanish), MySQL 5.0.67 community-nt via TCP/IP (InnoDB Engine)

Thank so much for your help.
hgomez

[/font]

Posted: 31.10.2008, 14:04
by mdaems
Sorry,

This ZStoredProcedure component isn't implemented for mysql (yet). So you'll have to do it using TZQuery and it's execsql method. There are quite some threads about this issue in the mysql part of this forum.

Mark

Posted: 10.06.2011, 23:48
by woolfik
And what about PostgreSQL it is the same problem.