Subject Re: [firebird-support] Re: Delphi6, Firebird 1.5 / Zeos - convert error
Author Martijn Tonies
Hi,


> thank you for replying,
> here my code, I get the error when executing ExecSql :
>
> -->>>>>
> procedure tform1.crea_batch;
> var kkk:integer;
> aaaa,mm,gg:word;
> begin
> yupdate.SQL.Clear;
> yupdate.SQL.Add('SELECT GEN_ID(GEN_bat_provvig_ID, 1) FROM
> RDB$DATABASE');
> yupdate.ExecSql;
> yupdate.active:=true;
>
> kkk:=yupdate.FieldByName('gen_id').AsINteger;
>
>
> with yupdate do begin
> SQL.Clear;
> SQL.Add('INSERT into bat_provvig ');
> SQL.Add('(kkk, ditta, amm, agente_mas, agente_par, docum_f_a,
> docum_aa, ');
> SQL.Add('docum_num, docum_data, tipo_movim, cliente_mas,
> cliente_par, pagamento, ');
> SQL.Add('netto_fattura, trasporto, zona_geog, q_deposito,
> provvigioni, ');
> SQL.Add('cod_spettanza, age2_mas, age2_par, scadenza_fatt,
> provvig_age2, tipo_ordine)');
> SQL.Add('values (:kkk, :ditta, :amm, ');
> SQL.Add(':agente_mas, :agente_par, :docum_f_a, :docum_aa, ');
> SQL.Add
> (':docum_num, :docum_data, :tipo_movim, :cliente_mas, :cliente_par, :p
> agamento, ');
> SQL.Add
> (':netto_fattura, :trasporto, :zona_geog, :q_deposito, :provvigioni, '
> );
> SQL.Add
> (':cod_spettanza, :age2_mas, :age2_par, :scadenza_fatt, :provvig_age2,
> :tipo_ordine)');
> ParambyName('kkk').AsInteger :=kkk;
> ParambyName('ditta').AsInteger :=yinput.fieldbyname
> ('ditta').asinteger;
> ParambyName('amm').AsInteger :=yinput.fieldbyname
> ('amministrazione').asinteger;
> .....
> .....
> ParambyName('tipo_ordine').Asinteger :=yinput.fieldbyname
> ('tipo_ordine').asinteger;
> ExecSQL;

So you get the error here?

> end;
> end;
>
> -----<<<<<
> The error messagge does not tell which field caused the exeption;

What's the _exact_ error message?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com