Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace / Delete and Tableupdate
Message
From
30/12/1999 23:21:25
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00310754
Message ID:
00310819
Views:
15
This sounds strange, Pablo, but try to reverse the order of what you are doing with SET DELETED OFF. Therefore, you do the DELETE, the REPLACE datetime, and then the TABLEUPDATE().


>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?
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform