Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exact and deleted recs - did everybody know this but me?
Message
From
24/07/2006 20:53:05
 
 
To
24/07/2006 16:04:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01139176
Message ID:
01139533
Views:
9
>>>>>>
>>>>>>SET DELETED OFF
>>>>>>
>>>>>
>>>>>You have turned off the DELETED filter. That is why you are getting deleted records. Change this to SET DELETED ON.
>>>>
>>>>I think I'm not making myself clear. I WANT deleted records returned, but I want them returned with the deleted flag set as it is set in the table itself. This only happens if DELETED, ANSI, and EXACT are all set off. If I set either ANSI or EXACT to ON, the deleted flag is wiped out and the record is returned as non-deleted. I can't find any documentation that says why ANSI or EXACT should cause such behaviour.
>>>
>>>You have to understand one fundamental thing, namely that the ANSI standard is to ignore deleted records completely, since deleted records are considered non-existent, and may in all "normal" sql systems be reused without your control. VFP is not "normal", and if you need to see the deleted flag, you have to trick it. One trick is to set ANSI off and EXACT off, as you have found out. Another, and much better, solution is to forget about the deleted flag, and in stead add a logical field, personally I call this field Active.
>>
>>If I were writing this thing from scratch, I'd do as you suggest, but unfortunately, with only God knows how many lines of code existing in this app, I don't have that luxury. Do you think it's safe to count on tricking VFP the way I'm doing it? I explained it in another message (to Mike Yearwood) that I'm trying to find a way around an SQL call taking too long, so I need to see deleted records in the returned cursor with their flags still set in order to speed things up.
>>
>>I can speed things up from anywhere from 10 to 20 seconds down to sub 1 second if I can use this trick. But if this behaviour is likely to change in order to standardise along ANSI lines, then I need to find another way to do it, and nothing else I've tried has really worked well so far.
>>BTW the table does have an index tag for DELETED().
>
>Approximately how many records do you usually select?

Depends on which query is running. Might only be 1 record, might be 10 records. Probably not more than 10 or so right now. As their use of the system grows, that number could rise dramatically.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform