FireDAC.Comp.Client.TFDCustomConnection.GetLastAutoGenValue
Delphi
function GetLastAutoGenValue(const AName: String): Variant;
C++
System::Variant __fastcall GetLastAutoGenValue(const System::UnicodeString AName);
Contents
Properties
| Type | Visibility | Source | Unit | Parent | 
|---|---|---|---|---|
| function | public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp  | 
        FireDAC.Comp.Client | TFDCustomConnection | 
Description
Returns the last autogenerated value.
The GetLastAutoGenValue method returns the last autogenerated value. The meaning and result depend on the DBMS, as described in the following table.
| 
 DBMS  | 
 Description  | 
|---|---|
| 
 Oracle  | 
 
  | 
| 
 InterBase / Firebird  | 
 
  | 
| 
 MS SQL Server, MySQL etc  | 
 The last autogenerated value in the session.  | 
Example
ShowMessage(VarToStr(ADConnection1.GetLastAutoGenValue('MyGen')));