Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving space with Varchar
Message
 
 
À
05/09/2008 22:36:10
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01345228
Message ID:
01345577
Vues:
16
Thx Dragan

It's not really a diskspace issue.

I think the customer thought they could beat the 2GB file limit with VFP by "compressing" the data using a special field type.

I've told them that really either moving some of the fields to another relational table or stepping up to SQL server would be best.

They are concerned that using compression software would slow things down too much.

>>>I thought the varchar field type would save space in the file size of my table?
>>>
>>>I have a table that has thousands of records and many character fields, I thought by changing the character fields to varchar the table size would be reduced?
>>>
>>>Have I got this all wrong?
>>
>>The table size is not reduced. As I understand it, VFP VarChar is there mainly to improve interoperability with SQL Server. IIRC another effect is different handling of trailing spaces/column padding. See the help: "HELP FIELD TYPES" for VarChar, including the code sample.
>
>The other difference is the length of the field, as returned by the len() function - it shouldn't include the padding, i.e. it would return the position of the rightmost character before the first chr(0). Seek() should also work differently - wherever we had implied padding with regular character fields, we may have strings of different lengths, or at least strings behaving as if of different lengths.
>
>With varchar fields, you find
>
>calc max(len(cfield)) to maxlen
>
>there is no more the need for
>
>calc max(len(trim(cfield))) to maxlen
Rob
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform