RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomSQLDataSet.Prepared Property

Specifies whether the command is prepared before execution.

Pascal
property Prepared: Boolean;
C++
__property Boolean Prepared;

SQL datasets are automatically prepared when you call Open or ExecSQL (or ExecProc). When a SQL dataset is prepared, dbExpress and the server allocate resources for the SQL statement and its parameters. If CommandType is ctTable, the dataset generates its SELECT query when it is prepared. Any parameters that are not bound by the server are folded into a query when it is prepared. 

If you execute the query or stored procedure more than once, you can improve performance by setting Prepared to true before opening the dataset. Setting Prepared to true prepares the dataset at once, rather than waiting until the dataset is opened. 

Conversely, set Prepared to false if you want to ensure that the dataset is re-prepared before it executes (for example, if you change a parameter value or the SortFieldNames property). 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!