From RAD Studio API Documentation
Jump to: navigation, search


property Prepared: Boolean read FPrepared write SetPrepared default False;


__property bool Prepared = {read=FPrepared, write=SetPrepared, default=0};


Type Visibility Source Unit Parent
property public
Data.SqlExpr TCustomSQLDataSet


Specifies whether the command is prepared before execution.

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).

See Also