Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace / Delete and Tableupdate
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Replace / Delete and Tableupdate
Miscellaneous
Thread ID:
00310754
Message ID:
00310754
Views:
60
Hi again,

I'm aplying the good code from Jim Booth for doing transactions, and everything is ok, well I have a problem:

I update i.e. three tables: table1, table2 and table3
in table1 I delete one record
and in table2 and table2 I create one more, just a sample.

The problem is cause I have a field in table1 to track the datetime when a record is deleted (dtdeleted field)

I use:

SELECT table1
REPLACE dtdeleted WITH DATETIME()
llret = TABLEUPDATE(1,.F.,"table1")
DELETE

I cannot do with this:

SELECT table1
REPLACE dtdeleted WITH DATETIME()
DELETE
llret = TABLEUPDATE(1,.F.,"table1")

cause the replace is ignored!! ???

... add records to table2 and table3...

and then BEGIN TRANSACT.... in Jim's way

the problem is if the transaction fails, the tableupdate before the DELETE doesn't reverts (I know this is normal).

But how can do for reverting ALL in the transaction?
Pablo Roca
Clavo Congelados, S.A. (La Coruna - Spain)
Sysop of PortalFox

Join MasFoxPro campaign
http://www.masfoxpro.com
Next
Reply
Map
View

Click here to load this message in the networking platform