property RefetchOnInsert: TStrings;
The RefetchOnInsert property allows you to easily retrieve specific field values after an Insert or Update statement. If you have an auto increment field or perhaps a timestamp field that is inserted by a trigger, you can use this property to return those values. This property will work for a single transaction or a group of transactions.
Specify the fields that you want to retrieve in the RefetchOnInsert property editor. Whenever an Insert statement is fired, the values will be returned to the client. The AfterRefetchOnInsert event will notify you when the values have been returned. Code that event if you need to take immediate action with the returned value.
If an auto increment field is defined and included in this list of fields, then you must code the OnInsertAutoIncrementFetch event on the TAstaServerSocket. For Paradox and Access a call to Max(FieldName) is made. For SQLServer and SQL Anywhere you can code a call to the variable @@identity to retrieve the last autoincrement value. The ASTA server then uses this value, or the prime key fields values to fetch all of the fields as specified in the RefetchOnInsert property. All of the server SQL is executed and when it is completed, the RefetchOnInsert values are streamed from the ASTA server and matched up to the appropriate rows in the TAstaClientDataSet.
Note: this property will not work if your database does not support transactions.