FireDAC.Comp.Client.TFDCustomConnection.GetLastAutoGenValue

From RAD Studio API Documentation
Jump to: navigation, search

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

Delphi

function GetLastAutoGenValue(const AName: String): Variant;

C++

System::Variant __fastcall GetLastAutoGenValue(const System::UnicodeString AName);

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 

AName is the name of a sequence. The method returns CurrValue if it exists in the session. 

InterBase / Firebird 

AName is the name of a generator. The method returns GEN_ID(0). 

MS SQL Server, MySQL etc 

The last autogenerated value in the session. 

Example

ShowMessage(VarToStr(ADConnection1.GetLastAutoGenValue('MyGen')));

See Also