FireDAC.Comp.Client.TFDCustomCommand.CommandKind
Delphi
property CommandKind: TFDPhysCommandKind read GetCommandKind write SetCommandKind
C++
__property Firedac::Phys::Intf::TFDPhysCommandKind CommandKind = {read=GetCommandKind, write=SetCommandKind, stored=IsCKS, default=0};
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomCommand |
Description
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;