Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exact and deleted recs - did everybody know this but me?
Message
From
25/07/2006 08:53:35
 
 
To
25/07/2006 08:49:12
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01139176
Message ID:
01139642
Views:
10
>>>>With NOFILTER (and deleted still off), yes, all records are returned and the deleted flag is wiped regardless of any other setting.
>>>>
>>>>What I haven't tested yet is whether or not it speeds up the query. That's my next step.
>>>>
>>>I have skipped most of the thread so pls forgive if I am totally off target:
>>>Since you seem to use SQL-Select, would not something like
>>>Select *, deleted() as lWasdeletd from ...
>>>fill your need the keep the info on the deleted() status of the base table for your next steps ?
>>>
>>>regards
>>>
>>>thomas
>>
>>Looks like this is going to be the best option. I just discovered something more about this whole process which means I can't use my own method in a consistent way anyway.
>>
>>This is the problem.
>>
>>With SET DELETED OFF:
>>
>>
SELECT id, firstname, lastname FROM tablename INTO CURSOR crsTemp
>>Will return deleted records with the deleted flag still set. However,
>>
>>
SELECT id, UPPER(firstname), UPPER(lastname) FROM tablename INTO CURSOR crsTemp
>>Will wipe out the deleted flag.
>
>That's the kind of risky behavior we were warning you about.
>
>>
>>UPPER() is just for illustrative purposes. Any function, or adding < something as field > in the select will wipe out the deleted flag. In some instances in this code, functions are used. So, it looks like your method is about the only way I can do what I need to.
>>
>>Thanks for the suggestion. So, the above then becomes:
>>
>>
SELECT id, UPPER(firstname), UPPER(lastname), DELETED() as deletedrec ;
>>FROM tablename INTO CURSOR crsTemp
>>And it works.
>>
>It will only work as long as you select from only one table. The minute you join in another table, it will fail to work again.

For the current purposes, that's not an issue. For any future code I have to write, I'll do it differently, but thanks for the reminder.
Previous
Reply
Map
View

Click here to load this message in the networking platform