EPUB | CHM | PDF

TPSQLCopy.Properties.RowsAffected

Top Previous Next

Returns the number of rows inserted into the table by the latest COPY execution.

Syntax:

property RowsAffected: Integer;

Description:

Inspect RowsAffected to determine how many rows were inserted by the last COPY operation. If no rows were affected RowsAffected has a value of zero. RowsAffected will have a value of -1 if the execution of the SQL statement could not be executed due to an error condition or if COPY TO was executed.

Example:

procedure TForm1.PSQLCopy1AfterCopyPut(Sender: TObject);
begin
  if PSQLCopy1.RowsAffected > -1 then
    ShowMessage(Format('%d rows were inserted', [PSQLCopy1.RowsAffected]));
end;