RAD Studio
ContentsIndex
PreviousUpNext
Representing the Results of a Query

Using a query is the most general way to specify a set of records. Queries are simply commands written in SQL. You can use either TSQLDataSet or TSQLQuery to represent the result of a query. 

When using TSQLDataSet, set the CommandType property to ctQuery and assign the text of the query statement to the CommandText property. When using TSQLQuery, assign the query to the SQL property instead. These properties work the same way for all general-purpose or query-type datasets. Specifying the query discusses them in greater detail. 

When you specify the query, it can include parameters, or variables, the values of which can be varied at design time or runtime. Parameters can replace data values that appear in the SQL statement. Using parameters in queries and supplying values for those parameters is discussed in Using parameters in queries

SQL defines queries such as UPDATE queries that perform actions on the server but do not return records. Such queries are discussed in Executing commands that do not return records.

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