Page 1 of 1

Get value of primary index?

Posted: Sun 14 May 2017 18:17
by kaffeburk
Hello,

When i use uniquery for mysql, how do i get the value of the just inserted primary key to the last record entered? (the value is set by mysql) Im using uniquery by a datasetprovider and i want the primary key after each insert (or append).

Regards,

Re: Get value of primary index?

Posted: Tue 16 May 2017 13:26
by ViktorV
This question is related to the specificity of working with TClientDataset, but not UniDAC. Therefore, to get an answer to the question, please refer to Embarcadero documentation, for example http://edn.embarcadero.com/article/20847 or ask a question at specialized forums.

Re: Get value of primary index?

Posted: Tue 16 May 2017 13:39
by kaffeburk
Apology's if i waw unclear. I'm not asking how i get the value from the provider or from the clientdataset. I'm asking how i get the value from tUniquery.

Re: Get value of primary index?

Posted: Tue 16 May 2017 13:48
by kaffeburk

Re: Get value of primary index?

Posted: Tue 16 May 2017 14:29
by ViktorV
UniDAC fills in auto-incremental fields automatically on inserting a new record to a dataset.
In order to get a detailed answer, please compose a small sample demonstrating the issue and send it to us using the contact form https://www.devart.com/company/contactform.html, including scripts for creating and filling database objects.

Re: Get value of primary index?

Posted: Tue 16 May 2017 15:31
by kaffeburk
Done.

Re: Get value of primary index?

Posted: Wed 17 May 2017 07:40
by ViktorV
To solve your problem, please set the TUniQuery.LocalUpdate property to False.
In the LocalUpdate mode data in dataset are changed locally but information about changes is not stored. So you cannot send the changes to the database.
For more information about these modes, please refer to UniDAC help:
https://www.devart.com/unidac/docs/inde ... update.htm