Data.SqlExpr.TSQLQuery
Delphi
TSQLQuery = class(TCustomSQLDataSet)
C++
class PASCALIMPLEMENTATION TSQLQuery : public TCustomSQLDataSet
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | Data.SqlExpr.pas Data.SqlExpr.hpp |
Data.SqlExpr | Data.SqlExpr |
Description
TSQLQuery represents a query that is executed using dbExpress.
Use TSQLQuery to execute an SQL command on a database server that is accessed via TSQLConnection. TSQLQuery can represent the results of a SELECT statement or perform actions on the database server using statements such as INSERT, DELETE, UPDATE, ALTER TABLE, and so on. You can add a TSQLQuery component to a form or data module at design time, or create one dynamically at runtime.
TSQLQuery is a unidirectional dataset. Unlike other datasets, unidirectional datasets do not buffer multiple records in memory. Because of this, you can only navigate using the First and Next methods. There is no built-in editing support: you can only edit the data in an SQL query by explicitly creating an SQL UPDATE command or by connecting the dataset to a client dataset using a provider. Features that require buffering multiple records, such as filters or lookup fields, are not available.
Before you can use a TSQLQuery component, it must be connected to the database server. Therefore, the first step to take when working with TSQLQuery is to set the SQLConnection property. Once the query is connected to a server, use the SQL property to specify the command your query executes.