FireDAC.Comp.Client.TFDCommand.CommandText

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: published
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDCommand

Delphi

property CommandText;

C++

__property CommandText;

Description

The text of the SQL command to execute.

FireDAC.Comp.Client.TFDCommand.CommandText inherits from FireDAC.Comp.Client.TFDCustomCommand.CommandText. All content below this line refers to FireDAC.Comp.Client.TFDCustomCommand.CommandText.

The text of the SQL command to execute.

The CommandText sets/gets:

  • The text of SQL command to execute.
  • The name of the stored procedure to execute, if CommandKind is in [skStoredProc, skStoredProcWithCrs, skStoredProcNoCrs].

After setting CommandText, FireDAC will execute the following actions for non-stored procedures:

If you add a long command, using the CommandText.Add method, then it is recommended to call CommandText.BeginUpdate before the command modification and CommandText.EndUpdate after finishing the command modification.

Later, when Prepare is called, the command text will be preprocessed and transformed into a target DBMS command. See the chapter Preprocessing Command Text for details about FireDAC macros and escape sequences - preprocessor instructions.

See Also