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,
Get value of primary index?
Re: Get value of primary index?
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?
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?
The example from Embarcadero dont work. http://edn.embarcadero.com/article/20847 It will create an error
[img]
https://minfil.org/p3jeG3b6b3/negative_error.jpg
[/img]
https://minfil.org/p3jeG3b6b3/negative_error.jpg
[img]
https://minfil.org/p3jeG3b6b3/negative_error.jpg
[/img]
https://minfil.org/p3jeG3b6b3/negative_error.jpg
Re: Get value of primary index?
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.
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?
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
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