RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLQuery Class

TSQLQuery represents a query that is executed using dbExpress.

Pascal
TSQLQuery = class(TCustomSQLDataSet);
C++
class TSQLQuery : public TCustomSQLDataSet;

SqlExpr

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. 

 

TSQLDataSet 

TSQLStoredProc 

TSQLTable 

TSQLConnection 

TClientDataSEt 

TDataSEtProvider 

Types of Datasets 

Specifying the Command to Execute 

Types of Unidirectional Datasets

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!