Hi all,
This may be uncommon, but I'm working with a database (Powerflex) who's ODBC driver doesn't support transactions. So if an error occurs during a set of UPDATE, INSERT and DELETE SQL commands, I'm left in limbo.
Originally, I'd hand write an SQL statement that was the reverse of the one I just executed, store it in a TStringList, catch the exception, and then play out those reverse statements. Crude, but it worked. And it doubled the amount of SQL I'd have to write, plus encouraged sync errors between the statement pairs.
So, embarking on a new project with lots of SQL throughout, I thought I'd be smart about it and write TAutoRollback, which executes the original SQL statement I give it, but before it does parses through it and automagically generates the reverse statement. It's a fair bit of crunching but I'm getting there. And it's only now 60% done that I think that perhaps all this work has been done before by smarter people.
Does anyone know of a rollback component that can automatically reverse SQL commands?
This may be uncommon, but I'm working with a database (Powerflex) who's ODBC driver doesn't support transactions. So if an error occurs during a set of UPDATE, INSERT and DELETE SQL commands, I'm left in limbo.
Originally, I'd hand write an SQL statement that was the reverse of the one I just executed, store it in a TStringList, catch the exception, and then play out those reverse statements. Crude, but it worked. And it doubled the amount of SQL I'd have to write, plus encouraged sync errors between the statement pairs.
So, embarking on a new project with lots of SQL throughout, I thought I'd be smart about it and write TAutoRollback, which executes the original SQL statement I give it, but before it does parses through it and automagically generates the reverse statement. It's a fair bit of crunching but I'm getting there. And it's only now 60% done that I think that perhaps all this work has been done before by smarter people.
Does anyone know of a rollback component that can automatically reverse SQL commands?