I have two sql sentence in Delphi 10.
Code: Select all
SqlText[0] := 'UPDATE table SET column1 = 1 WHERE id = 10;';
SqlText[1] := 'INSERT INTO table (column1, column2) VALUES (:column1, :column2);';
Code: Select all
sqlConn1.Query1.SQL.Text := SqlText[1];
sqlConn1.Query1.ParamByName('column1').Value := 10;
sqlConn1.Query1.ParamByName('column2').Value := 15;
Code: Select all
for i := Low(SqlText) to High(SqlText) do
begin
Query1.SQL.Text := SqlText[i];
Query1.ExecSQL;
end;
Code: Select all
for i := Low(aSqlText) to High(aSqlText) do
begin
if i= 0 then Query1.ParamCheck := False;
if i= 1 then Query1.ParamCheck := True;
Query1.SQL.Text := aSqlText[i];
Query1.ExecSQL;
end;
Regards,
Matija