Reputation: 41
I have setup a simple TFDQuery that is tied to TFDUpdateSQL Component to handle updates. The TFDUpdateSQL Insert sql inserts a row in to a table and after that calls scope_Indetity to get the latest Identity insert value. I want to read this value in the OnUpdateRecord event handler . I am trying to read it using the TFDUpdateSQl.Dataset.Fields[0].Asinteger but this returns 0 as value eerytime. Can someone help me understand how i can read results of insert in OnUpdateRecord.
Upvotes: 1
Views: 291
Reputation: 121
You need to use OnNewRecord
for insert, OnUpdateRecord
for Edit/Update.
It depends on how you are working with DB and how the Identity is created/added.
Maybe you will need to use AfterPost
.
Upvotes: 1