Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL and DELETED()
Message
From
18/12/2002 03:57:30
Liam O'Hagan
O'Hagan Programming Ltd
Ireland
 
 
To
17/12/2002 15:02:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00733705
Message ID:
00733997
Views:
24
Hi Jim,

Just to be clear : The quote "...may get unexpected results" was me quoting from memory. The actual phrase is "might yield unexpected results". (g)

I believe that they're being pretty clear about it. They explain what not to do and why not to do it. They can't be any more clear about the possible consequences as they would depend on the environment at the time.

Regards,

Liam


>SET DELETED ON has always worked in SQL for me too.
>But I wouldn't call the "...may get unexpected results" statement "very clear".
>
>
>>Hi Peter,
>>
>>I've never had a problem with SET DELETED. It has always worked as expected for me.
>>
>>I wouldn't agree with you that it's "misleadingly supported". MS is very clear about it : Be careful, you may get unexpected results.
>>
>>Regards,
>>
>>Liam
>>
>>
>>>Hi to all,
>>>
>>>I'm wondering... Since long I propagate that SQL-statements should exclude deleted records (if that's what you want) by using WHERE NOT DELETED() in the statement. I have this idea that the Select-SQL reacts to the setting of SET DELETED, but that it's not waterproof, that it may happen that occasionally deleted records will be included anyway, unexpectedly. Therefore, I always exclude them by using WHERE NOT DELETED() explicitly in the statement.
>>>However, this poses a problem if the Select-SQL gets data from two or more tables, since the alias-argument of DELETED() isn't supported as you'd expect. (Rather, it's misleadingly supported, since it may point to a table/cursor that's not involved in the Select-SQL - which uses USE .. AGAIN - but does exist and has a record pointer and thus always returns the same result, True or False.)
>>>
>>>I've added an item to the wishlist: Support for use of local alias when referencing functions like DELETED() and RECNO() in SQL-Query Wish #1093
>>>
>>>But what I'm now interested in: Have others experienced unexpected results with SET DELETED ON and therefore do the same as I do? Or is everybody happy with using SET DELETED ON preceding the Select-SQL?
Liam O'Hagan
MCP VFP Desktop Apps
Previous
Reply
Map
View

Click here to load this message in the networking platform