How to get the ID of the last addition or editing line after the record?

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dmytrodubrovin
Posts: 4
Joined: Wed 17 Jul 2019 06:26

How to get the ID of the last addition or editing line after the record?

Post by dmytrodubrovin » Wed 17 Jul 2019 06:45

How to get the ID of the last addition or editing line after the record?
I use visual components for online data editing (pgQuery, pgDataSet).

Code: Select all

procedure TUniForm11.UniButton2Click(Sender: TObject);
 begin
   PgDSFirm.DataSet.Append; 
 end;
 
 procedure TUniForm11.UniButton3Click(Sender: TObject);
 begin
   PgDSFirm.DataSet.Post;
   // Id need to get here!!!
 end;
Thank you all in advance!

MaximG
Devart Team
Posts: 1375
Joined: Mon 06 Jul 2015 11:34

Re: How to get the ID of the last addition or editing line after the record?

Post by MaximG » Wed 17 Jul 2019 10:49

You can use the DMLRefresh property to implement the behavior you described : https://www.devart.com/pgdac/docs/devar ... efresh.htm

dmytrodubrovin
Posts: 4
Joined: Wed 17 Jul 2019 06:26

Re: How to get the ID of the last addition or editing line after the record?

Post by dmytrodubrovin » Wed 17 Jul 2019 12:38

It is not clear how to use it. The documentation says nothing about usage. Could you share a usage example?

dmytrodubrovin
Posts: 4
Joined: Wed 17 Jul 2019 06:26

Re: How to get the ID of the last addition or editing line after the record?

Post by dmytrodubrovin » Wed 17 Jul 2019 12:54

Understood! Thank!!!!

MaximG
Devart Team
Posts: 1375
Joined: Mon 06 Jul 2015 11:34

Re: How to get the ID of the last addition or editing line after the record?

Post by MaximG » Thu 18 Jul 2019 05:02

We are glad that you found a necessary solution. Please don't hesitate to contact us with questions concerning PgDAC usage.

Post Reply