Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tableupdate index problem
Message
De
06/01/2001 23:23:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Tableupdate index problem
Divers
Thread ID:
00460295
Message ID:
00460295
Vues:
46
Hi,

I've been having problems with an index getting messed up when issuing a TableUpdate. The problem happens on an ordered table using optimistic row buffering. When there is a conflict I just want to force the last change. The force messes up the index (phantom record.) A Reindex fixes it. The code below will duplicate the problem. (At least with VFP5) Any ideas?

Thanks,
Bill
CLOSE All Databases
SET MultiLocks On

CREATE TABLE TestTable ;
	(nID I, ;
	cName C(20))

INSERT into TestTable (nID,cName) ;            &&Add 3 Records
VALUES (1,"BETA")

INSERT into TestTable (nID,cName) ;
	values (2,"ALPHA")

INSERT into TestTable (nID,cName) ;
	values (3,"ZULU")

SELECT TestTable  &&Create compound tag
INDEX on cName tag cName
USE

USE TestTable in 0 SHARE           &&Open table twice and buffer
USE TestTable again in 0 Alias "TestT2" SHARE
=CURSORSETPROP("Buffering", 3, "TestTable")
=CURSORSETPROP("Buffering", 3, "TestT2")

SELECT TestTable            &&Go to 2nd record in each
SET order to tag cName
GOTO top
Skip

SELECT TestT2
SET order to tag cName
GOTO top
Skip

SELECT TestTable
REPLACE cName with "ZBETA"

SELECT TestT2
REPLACE cName with "ABETA"

SELECT TestTable            &&Commit Change by changing row
Skip

SELECT TestT2
=tableupdate(0,.t.,"TestT2")            &&Force This value
Skip

GOTO TOP
BROWSE              &&Messed up index-phantom record
Bill Leber
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform