FireDAC.Comp.Client.TFDCustomCommand.CommandKind

From RAD Studio API Documentation
Jump to: navigation, search

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

Delphi

property CommandKind: TFDPhysCommandKind read GetCommandKind write SetCommandKind

C++

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

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