Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exact and deleted recs - did everybody know this but me?
Message
De
24/07/2006 11:35:07
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01139176
Message ID:
01139210
Vues:
14
I just tried it and it doesn't change anything. With EXACT ON (or ANSI ON) and using NOFILTER, I still get back the deleted record as a non-deleted record in the cursor. I appears to be EXACT and ANSI that are controlling whether or not the deleted record is brought back as a deleted record or as a non-deleted record.

I wonder if it's just a bug. Hard to believe this is the intended behaviour - especially since the documentation seems to make no mention of it.

>Add NOFILTER.
>
>>I just discovered that SET EXACT and SET ANSI affect whether or not a SELECT SQL statement will return deleted records as deleted or not.
>>
>>Am I the only person who didn't know this?
>>
>>According to the VFP9 help file in fact, SET EXACT is supposed to have no effect on a SELECT SQL statement at all. SET ANSI is supposed to affect how strings are compared in a SELECT statement. And I can't find anything in the help file to explain how deleted records are treated by EXACT and ANSI.
>>
>>So why do they both affect how deleted records are retrieved?
>>
>>Here is an example of what I'm seeing.
>>
>>
>>CLOSE DATABASES all
>>
>>CREATE TABLE test (field1 c(1))
>>FOR x = 1 TO 10
>>  INSERT INTO test (field1) VALUES (chr(x+64))
>>ENDFOR
>>
>>GOTO 8
>>DELETE
>>
>>CLOSE DATABASES all
>>SET DELETED OFF
>>SET ANSI OFF
>>SET EXACT OFF
>>
>>WAIT WINDOW "Ansi off, Exact off" NoWait
>>SELECT * FROM test	&& browse should show record 8 as deleted
>>CLOSE DATABASES all
>>SET EXACT ON
>>
>>WAIT WINDOW "Ansi off, Exact ON" NoWait
>>SELECT * FROM test	&& browse should show no deleted records
>>CLOSE DATABASES all
>>SET EXACT OFF
>>SET ANSI ON
>>
>>WAIT WINDOW "Ansi ON, Exact off" NoWait
>>SELECT * FROM test	&& browse should show no deleted records
>>CLOSE DATABASES all
>>SET EXACT OFF
>>SET ANSI OFF
>>
>>WAIT WINDOW "Ansi off, Exact off" NoWait
>>SELECT * FROM test	&& browse should show record 8 deleted again
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform