gutonovaes19 Novato

Registrado: Quarta-Feira, 18 de Junho de 2008 Mensagens: 50
|
Enviada: Qua Mai 08, 2019 6:09 pm Assunto: ZeosLib TZStoredProc Resultado não commitado no banco |
|
|
Boa noite.
Estou quebrando a cabeça mas não consegui identificar o problema,
Tenho uma SP no mysql, que já testei diretamente no BANCO.
CREATE DEFINER=`opt_web`@`%` PROCEDURE `PTrocaCodigoColaborador`(`CodigoAntigo` int(11),`CodigoNovo`int(11), `idEmpresaAnterior` int(11), `idEmpresaNova` int (11))
BEGIN
update dbogeralepicolaboradores set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dbopcmsoasoentregues set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dbogeralprofissiografia set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dbopcmsoconvocados set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dbopcmsoexamesrealizados set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dbopppcat set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dbopppexposicao set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dbopcmsoexfun set idColaborador = CodigoNovo where idColaborador = CodigoAntigo;
update dboagendahorarios set idReferencia = CodigoNovo and idEmpresa = idEmpresaNova where idReferencia = CodigoAntigo and idEmpresa = idEmpresaAnterior;
delete from dbogeralcolaboradores where id = CodigoAntigo;
END;
No Delphi 7, componentes Zeos 7 , usando TZStoreproc...
ZStoredProc1.Connection := dmmain.zconweb;
ZStoredProc1.CleanupInstance;
ZStoredProc1.StoredProcName := dmmain.zconweb.Database+'.PTrocaCodigoColaborador';
ZStoredProc1.Params.Clear;
with ZStoredProc1.Params.CreateParam(ftInteger, 'CodigoAntigo', ptInput) do AsInteger := 0;
with ZStoredProc1.Params.CreateParam(ftInteger, 'CodigoNovo', ptInput) do AsInteger := 0;
with ZStoredProc1.Params.CreateParam(ftInteger, 'idEmpresaAnterior', ptInput) do AsInteger := 0;
with ZStoredProc1.Params.CreateParam(ftInteger, 'idEmpresaNova', ptInput) do AsInteger := 0;
dmmain.zconweb.StartTransaction;
ZStoredProc1.ParamByName('CodigoAntigo').asinteger := 41091;
ZStoredProc1.ParamByName('CodigoNovo').asinteger := 60343;
ZStoredProc1.ParamByName('idEmpresaAnterior').asinteger := 462;
ZStoredProc1.ParamByName('idEmpresaNova').asinteger := 448;
ZStoredProc1.ExecProc;
dmmain.zconweb.Commit;
result := true;
except
on e: exception do
begin
if dmmain.zconweb.InTransaction then
dmmain.zconweb.Rollback;
result := false;
end;
end;
Executo porém nada acontece no banco. Os registros que estou a fazer update permanecem como eram.
O que pode ser? |
|