1
Follows the code:
var
i : integer;
begin
i := 0;
DataModule1.ZConnection1.Database := edtDB.Text;
DataModule1.ZConnection1.HostName := edtLocal.Text;
DataModule1.ZConnection1.User := 'root';
DataModule1.ZQuery1.Close;
DataModule1.ZQuery1.SQL.Clear;
DataModule1.ZQuery1.SQL.Add('SHOW TABLES FROM '+edtDB.Text);
DataModule1.ZQuery1.Open;
while not DataModule1.ZQuery1.Eof do
begin
inc(i);
DataModule1.ZQuery2.Close;
DataModule1.ZQuery2.SQL.Clear;
DataModule1.ZQuery2.SQL.Add('CHECK TABLE ' + edtDB.Text + '.' +
DataModule1.ZQuery1.FieldByName('Tables_in_' + edtDB.Text).asString);
DataModule1.ZQuery2.ExecSQL;
DataModule1.ZQuery1.Next;
end;
What I want is that to the end of the lines found in showTables
(which is situated on the first dbgrid), my check read all lines (With the Tables) and consequently give a check
in another dbgrid, how do I do this?
Updated code
what would be the record quantity command you commented on?
– Ramon Ruan
it is giving a Syntax SQL error.
– Ramon Ruan
It depends on its component. In a
TClientDataSet
for example isCDS.RecordCount
– Filipe.Fonseca
Put a breakpoint on
DataModule1.ZQuery2.Open;
and pass me the value ofDataModule1.ZQuery2.Sql.Text
– Filipe.Fonseca
he managed to make a test, the problem was in the parameter itself,
',' +
He’s doing all the checking, but it doesn’t show everything.– Ramon Ruan
It doesn’t show everything because you took out the comma! Put
Parametro := Parametro + ', ' + edtDB.Text + '.' + DataModule1.ZQuery1.FieldByName('Tables_in_' + edtDB.Text).asString);
– Filipe.Fonseca
It worked, it worked!!!
– Ramon Ruan
I edited with the while explanation. As for the Pair, it’s another (almost)completely different story.
– Filipe.Fonseca