How to get autoincrease integer after insertion?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lohmann
Posts: 2
Joined: Mon 16 Nov 2009 07:18

How to get autoincrease integer after insertion?

Post by lohmann » Mon 16 Nov 2009 07:47

Hi, all,

The table has an autoincrease type primary key, I would like to get its value after insertion. How can I get this value with an Query component?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 16 Nov 2009 09:55

You can read this value from the corresponding field. For example:

UniQuery.Post;
i := UniQuery.FieldByName('id').AsInteger;

Post Reply