Get Auto Inc ID
Posted: 29.11.2009, 05:37
Hi there,
I'm back to programming software to pc using D2009 and mysql. I started using MyDAC to access the data base. It is good, but isn’t free. So I kept looking for and I found the Zeos. I installed and made a simple example, the next step was get the value of ID auto increment field. I read some solutions using last_insert_id, but in my studies I found into event "AfterInsertSQLStament" on ZUpdateSQL a parameter "out UpdateAutoIncField: Boolean" and I put the parameter to true into procedure, after that the value of field ID already fill automatically.
So, as I found nothing about this method to get the autoincfield, I have a question about this. Is ok to use it to get the value of this kind of fields?
I'm back to programming software to pc using D2009 and mysql. I started using MyDAC to access the data base. It is good, but isn’t free. So I kept looking for and I found the Zeos. I installed and made a simple example, the next step was get the value of ID auto increment field. I read some solutions using last_insert_id, but in my studies I found into event "AfterInsertSQLStament" on ZUpdateSQL a parameter "out UpdateAutoIncField: Boolean" and I put the parameter to true into procedure, after that the value of field ID already fill automatically.
So, as I found nothing about this method to get the autoincfield, I have a question about this. Is ok to use it to get the value of this kind of fields?