Data.SqlExpr.TSQLQuery.PrepareStatement

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure PrepareStatement; override;

C++

virtual void __fastcall PrepareStatement();

Properties

Type Visibility Source Unit Parent
procedure
function
public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr TSQLQuery

Description

Prepares the query for execution.

PrepareStatement performs most of the necessary tasks for preparing a query to be executed on the server. It ensures the dbExpress and the database server have allocated any resources they need for executing the query and binding its parameters. Any named parameters are temporarily converted to unnamed parameters because dbExpress does not support named parameters.

Do not call PrepareStatement when preparing a query for execution. Instead, set the Prepared property to true. When you use the Prepared property instead, the query keeps track of the fact that it has already been prepared and need not repeat the process every time it executes the query. In addition, when you set the Prepared property, the query initializes internal properties that keep track of the number of rows affected by the query.

See Also