Data.SqlExpr.TCustomSQLDataSet.Prepared

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Prepared: Boolean read FPrepared write SetPrepared default False;

C++

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

Properties

Type Visibility Source Unit Parent
property public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr TCustomSQLDataSet

Description

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