API:FireDAC.Comp.Client.TFDCommand.CommandKind
Delphi
property CommandKind: TFDPhysCommandKind read GetCommandKind write SetCommandKind stored IsCKS default 0;
C++
__property CommandKind = {default=0};
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCommand |
Description
Identifies the kind of the command.
FireDAC.Comp.Client.TFDCommand.CommandKind inherits from FireDAC.Comp.Client.TFDCustomCommand.CommandKind. All content below this line refers to FireDAC.Comp.Client.TFDCustomCommand.CommandKind.
Identifies the kind of the command.
The CommandKind property identifies the kind of the content of the CommandText property.
You can explicitly set its value before calling Prepare, otherwise it will be automatically assigned by FireDAC after analyzing the CommandText content. There is only one case when you need to assign it: when you prepare a stored procedure.
Example
//Example 1:
ADCommand1.CommandKind := skStoredProc;
ADCommand1.CommandText.Text := 'MY_PROC';
ADCommand1.Prepare;
//Example 2:
ADCommand1.CommandText.Text := 'ALTER PROCEDURE MY_PROC COMPILE';
case ADCommand1.CommandKind of
skAlter: ShowMessage('Alter command');
..........
else ShowMessage('Other command');
end;