Transactions, Commits and Rollbacks

Ivan Smahin ivan_smahin at paradigmasoft.com
Fri Oct 11 23:51:20 CDT 2013


On Oct 12, 2013, at 3:54 AM, "Johnny Harris" <johnny at southshore.com> wrote:

> Hi Joseph,
> 
> Just an example would be: If I had a database that had invoices in it and I want to delete all the records from the database
> for year 1980. The invoices are stored in one table and each line item on the invoice is stored in another table. I need to be
> sure that when an invoice is deleted the line items for that invoice are also deleted. Of course the key for each invoice is stored as a field
> in the invoice items table to perform the delete on.
> 
> This is easily done with transactions, but I'm kind of clueless right now of the best way to achieve it with Valentina.
> 
> I wonder if a delete trigger might work reliably?
> 
> Any help or ideas you may have are much appreciated.
> 
> I don't usually need this type of query often, but when this type of task is needed it is usually deleting many records.
> 


You have few ways to do it.
1. You can use link's cascade deleting feature.
2. OnDelete triggers.
3. Stored procedure way - to make any complex operation "atomic".

All of that ways are common for almost any RDBMS.
It is not directly related to transactions.


-- 
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list