I have two tables in Delphi, Sales
and SaleItem
, they are master detail and I need to calculate the totals (SUM) of the PriceItem
column in the SaleItem
table and save this value in the PriceTotal
column in the Sales
table.
But for this I need to do using database transactions. How to do that? I have never done it before, and I did not find anything specific that would allow me to do it on the internet.
How to use transactions in Delphi? I'm using Firedac controls and SQL Server 2014.