FireDAC.Comp.Client.TFDCustomCommand.CommandKind

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property CommandKind: TFDPhysCommandKind read GetCommandKind write SetCommandKind  stored IsCKS default skUnknown;

C++

__property Firedac::Phys::Intf::TFDPhysCommandKind CommandKind = {read=GetCommandKind, write=SetCommandKind, stored=IsCKS, default=0};

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;

See Also