On 7/13/06, Michael Hawksworth <[EMAIL PROTECTED]> wrote:
Thanks for the explanation! Experience is a wonderful when you have it!
"Only the foolish learn from experience — the wise learn from the
experience of others." — Attributed to Romanian folk wisdom
I'm expereinced <s>.
Cursors are great tools to work with. Like so many other things in
FoxPro, they can do wonders if you take the time to understand their
limitations. They can be your worst enemy if you use them wrong. like
using a screwdriver as a prybar.
Recently a fellow developer asked me for help on a project where
performance had degraded over time. She asked if adding DELETED() tags
might improve performance. As the tables were all relatively small in
size, I encouraged her to try it. The system stopped working. What had
happened was that they were working with some legacy (pre-6.0) code
that created the cursors from SQL statements and then used the old USE
(dbf('alias')) again trick to make them read-write. The physical
cursors were created on disk because SET DELETED was ON and there was
no DELETED() tag, so non-deleted records had to be copied to a
separate temp table to act as the cursor. With the addition of the
DELETED() tag, a filtered view into the underlying table could be
created, and when they tried to USE (dbf('alias')) AGAIN, they were
looking at the original table, and not the temp cursor. Bad things
ensued. We removed the tags and operations resumed.
Experience. Ain't it grand?
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.