Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does create sql view create bloat?
Message
From
16/07/1999 11:17:58
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00242308
Message ID:
00242323
Views:
22
Actually, I had just thought of that, and was coming here to post about it:-)

anyways... I tried to figure out if it was going to bloat on my own, and created the view in a for/next loop. Now I have 100's of deleted records in my database. Is there a "safe" way to pack the table? Or shall I re-create it. (Recreating it isn't too hard, would only take a second, but I'm curious to know if I can safely open the .dbc as a table and issue PACK.)

>If it is not updatable, then you could just do a SELECT...INTO CURSOR crsMyCursor. No need for a SQL View. Then when you close the tables and cursor, the tmep file that was created for the cursor is deleted.
>
>>Thanks Mark! The view is informational retrieval only (not update-able). It gets run once a month, by a single user. I would rather not put it into my massive CREATEVIEWS program since it is used so rarely. I only need to pull two fields out. I'm pretty sure this way will be ok. Thanks for the answer though, you told me just what I needed to know!
>>
>>>Every time you re-create a SQL view of the same name, the current records in the table that makes up the DBC all get deleted and new records for that view are inserted into the table. So, you you are bloating the table by deleting records and adding new ones. The problem is if you have made the view updatable, then by re-creating the view, you have just deleted all the update properties of the view. You can recreate them with dbsetprop and cursorprop functions, but this will wreak havoc on a multi-user system and is ill-advised.
>>>
>>>If your concern is structure changes to the source tables of the view, you are still better off having a static view and recreating the views when you change source table structures. Or you could use SDT and let that do all the work for you.
--Todd Sherman
-Wake Up! Smell the Coffee!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform