I'm having with problems with SP and Zeos.
I'm receiving the SQL Error 501.
The stored procedure code is here:Attempt to reclose a closed cursor. The cursor identified in a FETCH or CLOSE statement is not open.
Code: Select all
CREATE OR ALTER PROCEDURE SP_INSMOV (
tip_id integer,
pro_id integer,
fun_id integer,
data date,
qtd integer,
volumes integer,
ins_embal char(1),
ins_fisc char(1),
ins_inje char(1),
ins_ident char(1),
ins_oleo char(1),
nf varchar(30),
lote integer)
as
BEGIN
INSERT INTO MOVIMENTACAO (
TIP_ID,
PRO_ID,
FUN_ID,
DATA, QTD,
VOLUMES,
INS_EMBAL,
INS_FISC,
INS_INJE,
INS_IDENT,
INS_OLEO,
NF,
LOTE)
VALUES (
:TIP_ID,
:PRO_ID,
:FUN_ID,
:DATA,
:QTD,
:VOLUMES,
:INS_EMBAL,
:INS_FISC,
:INS_INJE,
:INS_IDENT,
:INS_OLEO,
:NF,
:LOTE
);
END
Code: Select all
procedure TfrmMovimentacao.btCadastrarClick(Sender: TObject);
begin
with DM.spMovimentacao do
begin
StoredProcName := 'SP_INSMOV';
ParamByName('TIP_ID').AsInteger := cbTipoMov.ItemIndex;
ParamByName('PRO_ID').AsInteger := cbProduto.ItemIndex;
ParamByName('FUN_ID').AsInteger := 1;
ParamByName('DATA').AsDate := dtpEntrega.Date;
ParamByName('QTD').AsInteger := StrToInt(leQuantidade.Text);
ParamByName('VOLUMES').AsInteger := StrToInt(leVolumes.Text);
ParamByName('INS_EMBAL').AsString := IntToStr(rgEmbalagem.ItemIndex);
ParamByName('INS_FISC').AsString := IntToStr(rgFiscal.ItemIndex);
ParamByName('INS_INJE').AsString := IntToStr(rgInjecao.ItemIndex);
ParamByName('INS_IDENT').AsString := IntToStr(rgIdentificacao.ItemIndex);
ParamByName('INS_OLEO').AsString := IntToStr(rgOleo.ItemIndex);
ParamByName('NF').AsString := leNotaFiscal.Text;
ParamByName('LOTE').AsInteger := 1{leLote};
ExecProc;
end;
end;
Always with the same error (501).
I'm using Delphi 2009, Zeos 7, Firebird 2.1
Thx!
P.S.: Sorry for my poor english, I tried my best.