Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
Update issue |
Thu, Nov 8 2018 8:51 AM | Permanent Link |
Huseyin Aliz myBiss ApS | Hi All,
I have 2 tables, service and tasks. Service has a taskno field as integer and task table has a serviceno as integer so updates in one table can be reflected in the other, and it works just fine. The issue here is that if the user deletes the task which service has a pointer to, the update in section 2 of following code " with RetOpgave do begin" does append a row in task table?? I have no insert or append, just update in the transaction, how can this happen? I have following code:  Database.StartTransaction;  try      with RetService do begin      Update;      Columns['Beskrivelse'].AsString:= BeskrivelseEdit.Text;      Save;      end;      if (RetService.columns['Opgaveid'].asInteger > 0) then begin      with RetOpgave do begin      Update;      Columns['Opgavenavn'].AsString:= BeskrivelseEdit.Text;      Save;      end;      end;      Database.Commit;      Showmessage('OK!');      except      Database.Rollback;      raise;  end; Thanks in advance, Hüseyin |
Mon, Nov 12 2018 2:34 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Huseyin,
<< I have 2 tables, service and tasks. Service has a taskno field as integer and task table has a serviceno as integer so updates in one table can be reflected in the other, and it works just fine. The issue here is that if the user deletes the task which service has a pointer to, the update in section 2 of following code " with RetOpgave do begin" does append a row in task table?? I have no insert or append, just update in the transaction, how can this happen? >> Updates automatically cause an Insert if there are no rows present, so just check the RowCount before doing the Update to make sure that there is a row to update. Tim Young Elevate Software www.elevatesoft.com |
Tue, Nov 13 2018 4:25 PM | Permanent Link |
Huseyin Aliz myBiss ApS | Tim,
Thanks for the info Regards, Hüseyin Den 12-11-2018 kl. 20:34 skrev Tim Young [Elevate Software]: > Huseyin, > > << I have 2 tables, service and tasks. Service has a taskno field as integer and task table has a serviceno as integer so updates in one table can be reflected in the other, and it works just fine. The issue here is that if the user deletes the task which service has a pointer to, the update in section 2 of following code " with RetOpgave do begin" does append a row in task table?? I have no insert or append, just update in the transaction, how can this happen? >> > > Updates automatically cause an Insert if there are no rows present, so just check the RowCount before doing the Update to make sure that there is a row to update. > > Tim Young > Elevate Software > www.elevatesoft.com > |
This web page was last updated on Friday, November 1, 2024 at 07:01 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |