Data.SqlExpr.TSQLQuery.RowsAffected

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property RowsAffected: Integer read GetRowsAffected;

C++

__property RowsAffected;

Properties

Type Visibility Source Unit Parent
property public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr TSQLQuery

Description

Indicates the number of rows operated on by the latest query execution.

Data.SqlExpr.TSQLQuery.RowsAffected inherits from Data.SqlExpr.TCustomSQLDataSet.RowsAffected. All content below this line refers to Data.SqlExpr.TCustomSQLDataSet.RowsAffected.

Indicates the number of rows operated on by the latest query execution.

When the SQL dataset represents a query that does not return a result set, you can't use the RecordCount property to ascertain the number of records affected by the query. In such cases, read RowsAffected to determine how many rows were updated or deleted by the query when it executed. If no rows were updated or deleted, RowsAffected is zero. RowsAffected is –1 if the SQL statement could not be executed due to an error condition. (This latter situation typically follows the throwing of an exception.)

See Also