FireDAC.Comp.Client.TFDCustomConnection.GetLastAutoGenValue

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetLastAutoGenValue(const AName: String): Variant;

C++

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

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 

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