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 14:01:43
 
 
To
24/07/2006 13:50:10
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01139176
Message ID:
01139321
Views:
12
Unfortunately, I'm working with code that has been around a while and there are parts that depend on ignoring deleted records (as you say, treating them as GONE!). The problem is that a couple of the Select SQL statements into arrays take about 10 seconds (or longer) to run either with DELETED set to ON or with the 'and !DELETED()' added to the SQL statement - even though there is an index tag for DELETED().

So what I wanted to do was to set DELETED OFF, do the select getting back all deleted records into a cursor (with their flags still set), and then select that cursor into the array with DELETED set back to ON. When I do that, I end up with the correct result, but it only takes a fraction of a second to do both steps together.

The question now, of course, is whether or not I can count on the behaviour remaining as it is. If so, then I'm ok. If not, then I have to find some other way to speed up the Selects so i don't get killed by this changing on me later.

>Alan
>
>I prefer to treat deleted records as GONE! What I do instead is add a datetime field for deactivated. Then I can delete records that are beyond a certain customer-specified age. Further I can retrieve such records under my direct control.
>
>I avoid SQLs that do the equivalent of a SET FILTER. When I run a query I expect a fixed result set.
>
>>Ah. The one thing I didn't try was with both ANSI and EXACT set ON, and the result is the sam as with them both set off. Then that answers the question. That being the case, then am I safe in doing what I'm doing in turning off EXACT and ANSI in order to keep the table's deleted flags set? Or do you think I'm playing with fire?
>>
>>>W/o NOFILTER VFP may create filtered cursor by applying SET FILTER/SET FIELDS to the source table opened similar to USE...AGAIN. It cannot be done when SET EXACT and SET ANSI doesn't match. I don't think it's documented anywhere.
>>>
>>>>Ok, you're right with NOFILTER. But if I want deleted records returned to the cursor as deleted, I need to set DELETED, ANSI and EXACT to OFF (and not include the NOFILTER keyword). My question is simply, why do exact and ansi control this? Is it documented somewhere?
>>>>
>>>>>Sure it does. All deleted records are returned as undeleted for all combinations of SET EXACT and SET ANSI which is expected behavior for SET DELTED OFF.
>>>>>
>>>>>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform