Board index » delphi » Update Generator Value
Roy
![]() Delphi Developer |
Update Generator Value2007-01-25 06:56:41 AM delphi77 I am using Interbase 7.5 and I have a few tables with Field "SID" as primary key. I am using a generator and a trigger to update the values for the primary key. The tables are populated with bulk entries automatically by the user program. My problem is that occassionally I get a PK violation on the SID values when the tables are updated. I know that this is happening because the value of the generator doesnot match the value of the last record in the table. If I manually edit the value of the Generator to the value of the last SID record then I do not get any errors. Please tell me how I set the value of the generator so that it matches the value of the last record in the table. I believe that I can use a Stored Procedure to do this but I do not know how to write the code. Thanks for your help, it is much appreciated.. Roy |