Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo Bloat during update routine...
Message
From
30/11/1999 13:25:11
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00296936
Message ID:
00297002
Views:
25
>>>I have an app that updates insurance plans. I store some general notes about each plan in a memo field. This field usually contains 7 or 8 small sentences. My problem is that when I populate this information (one sentence at a time) for thousands of plans the memo field bloats to >330 mb. After packing the memo (and 10 minutes) it goes down to 50mb. I'm worried about users running out of disk space. Is there a way to reduce this without stopping in the middle of the routine and doing a pack memo? I update the memo fields with the following code:
>>>
>>>REPL myMemo WITH ALLT(myMemo)+CHR(13)+cNewLine IN myTable
>>>
>>>I have also used the ADDITIVE reference:
>>>
>>>REPL myMemo WITH CHR(13)+cNewLine ADDITIVE IN myTable
>>>
>>>This gives no relief to the file size issue.
>>>
>>
>>Nope - VFP does not reuse blocks in a memo field when the field is updated, so each REPLACE is expensive - it create new blocks to write the entire field content fresh each time you update it. Why not build the memo field content before doing the REPLACE?
>
>I will be processing between 10 and 50 files updating different parts of insurance plans. each file may or may not require the memo field for a given plan. Instead of updating the plan table directly I could create a cursor with planID n(6), memo_line c(100) and populate the cursor instead. I could then scan through this cursor and build a variable for each plan and do the REPLACE with that variable into the Plan table. Does this sound feasible?
>

Sure, or create a cursor that holds a memo field - you can build the memo in the cursor and update - the bloat in the cursor goes away when it does...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform