dear community, a cordial greeting to all, after trying to execute without success by batch the postgres copy command I decided to try with lazarus, for that I am using a SQLConnector to execute this command, but I am not getting to do it, it seems that I am missing something else, this is the code that I am using.
procedure TForm1.Button1Click(Sender: TObject);
var
consulta: String;
begin
begin
consulta:='COPY recetasv1(fecha, hora, sapreceta, lote, orden, coordenada, sapinsumo, volumen, tiempo, temperatura, velagitador, velancla, velobular, velsilverson) FROM 'C:\Borrame\satosap.csv' DELIMITER ',' CSV HEADER';
SQLQuery1.Close;
SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Add(consulta);
SQLQuery1.ExecSQL;
end;
end.
when executing it I get this error.
Compilar proyecto, Objetivo: project1.exe: Código de salida 1, Errores: 1
unit1.pas(42,173) Fatal: Syntax error, ";" expected but "identifier C" found
it seems that it recognized that it is not sql so it gives me an error.
Maybe my approach is wrong?
Thank you for your kind attention.