I have a simple code where I copy from a temporary SQLite table to the main PostgreSQL table from an Android phone (after checking if I am connected or not).
Code: Select all
tblTemp.First;
while not tblTemp.Eof do
begin
qryPg.SQL.Text :=
'INSERT INTO foto_carico (id, nr_ordine, nr_foto, descrizione, immagine, dt_carico, hh_carico, sigla_abilitazione_foto, id_cliente_master) ' +
'VALUES (:id, :nr_ordine, :nr_foto, :descrizione, :immagine, :dt_carico, :hh_carico, :sigla_abilitazione_foto, :id_cliente_master) ' +
'ON CONFLICT (id, nr_ordine, nr_foto) DO NOTHING;';
qryPg.ParamByName('id').AsString := tblTemp.FieldByName('id').AsString;
qryPg.ParamByName('id_cliente_master').AsInteger := tblTemp.FieldByName('id_cliente_master').AsInteger;
qryPg.ParamByName('sigla_abilitazione_foto').AsString := tblTemp.FieldByName('sigla_abilitazione_foto').AsString;
qryPg.ParamByName('nr_ordine').AsString := tblTemp.FieldByName('nr_ordine').AsString;
qryPg.ParamByName('nr_foto').AsInteger := tblTemp.FieldByName('nr_foto').AsInteger;
qryPg.ParamByName('descrizione').AsString := tblTemp.FieldByName('descrizione').AsString;
qryPg.ParamByName('dt_carico').AsDate := tblTemp.FieldByName('dt_carico').AsDateTime;
qryPg.ParamByName('hh_carico').AsTime := tblTemp.FieldByName('hh_carico').AsDateTime;
qryPg.ParamByName('immagine').Value := tblTemp.FieldByName('immagine').Value;
qryPg.ExecSQL;
tblFotoTemp.Delete;
end;
Stop working with 9.0.1 giving this message: "invalid byte sequence for 'utf8' encoding".
- either SQLite and PostgreSQL are defined as UTF
- the code is untouched from 8.3.2 to 9.0.1, only recompiled
Can someone check what is worng on new version?
Thanks in advance.
Sergio