Debbie
2005-04-02 01:10:07 UTC
I have a problem deleting records during a Begin and End Transaction.
Basically this is what is happening:
If User1 is viewing a record in MYTABLE at the same time that User2 runs a
procedure to delete a batch of records from MYTABLE then all the records get
deleted except for the one that User1 was looking at. I have tried
including the following code, but it makes no difference!
SELECT mytable
SCAN
IF EXP1 = EXPR2
DO WHILE !RLOCK("mytable")
LOOP
ENDDO
DELETE IN mytable
TABLEUPDATE(0,.T.,"mytable")
UNLOCK IN mytable
ENDIF
ENDSCAN
Could someone please tell me where I am going wrong?
Many thanks - Debbie
Basically this is what is happening:
If User1 is viewing a record in MYTABLE at the same time that User2 runs a
procedure to delete a batch of records from MYTABLE then all the records get
deleted except for the one that User1 was looking at. I have tried
including the following code, but it makes no difference!
SELECT mytable
SCAN
IF EXP1 = EXPR2
DO WHILE !RLOCK("mytable")
LOOP
ENDDO
DELETE IN mytable
TABLEUPDATE(0,.T.,"mytable")
UNLOCK IN mytable
ENDIF
ENDSCAN
Could someone please tell me where I am going wrong?
Many thanks - Debbie