FireDAC.Comp.Client.TFDCustomCommand.CommandKind
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};
Propriétés
Type | Visibilité | Source | Unité | Parent |
---|---|---|---|---|
property | public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomCommand |
Description
Identifie le type de la commande.
La propriété CommandKind identifie le type du contenu de la propriété CommandText.
Vous pouvez définir explicitement sa valeur avant d'appeler Prepare, sinon elle sera automatiquement assignée par FireDAC après l'analyse du contenu de CommandText. Il existe seulement un cas où vous devez l'assigner : quand vous préparez une procédure stockée.
Exemple
//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;