>Thanks, I have tried to write something using these commands, and I am now much much more clear about these. But one more thing I would like to ask about tableupdate. It seems that the content change by tableupdate is still not permanent. It still can be undone with rollback, right?
>
>Regards,
>Ron
You're so right with that Ron. That is the difference between tablerevert and rollback.
begin transaction
insert into anytable (....) values (val1,val2)
tableupdate() && Will be permanent if sucessfull and an "end transaction" is encountered
tablerevert() && This has really no effect - Only rollback can do it
rollback
end transaction && This also has no effect and a mismatch for already a rollback encountered
is equivalent to
*Do nothing and the rec is not inserted
But in case of just buffering commands code behaves different.:
insert into anytable (....) values (val1,val2)
tableupdate() && Update committed and nonreversible - Permanent here if sucessfull.
tablerevert() && Nothing to revert- Already committed.
Rec is inserted.
Without buffering only rollback can revert.
Another point :
*begin transaction && If using nested transaction remove *
insert into anytable (....) values (val1,val2)
replace afld1 with "My value"
begin transaction
replace afld1 with "Dummy value"
tableupdate() && Will be permanent if sucessfull and an "end transaction" is encountered
rollback
tableupdate()
*end transaction && If using nested transaction remove *
In this case with or witout an outer transaction, afld1 will have a value of "My value" because begin trans. .. rollback part will act like a rem.
Regards
Cetin