Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary and Candidate
Message
De
03/08/2001 10:49:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
03/08/2001 10:40:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00538812
Message ID:
00539383
Vues:
22
>>> ...VFP requires n-bytes to store an N(n, d) field in a table.
>> I use integers, which use 4 bytes, but can store numbers up to 2e9.
>> Am I missing something here?
>Yes. The easiest way to understand how much space is required to store a N(n, d) field in a VFP table is to create two tables with a single numeric field, say N(1,0) for the first table and N(8, 0) for the second table. Leave the table empty and check the size of the tables (same size). Add a record in each table and check sizes again. The N(8,0) table takes 7 more bytes of disk space.

Why would I want to use N(8,0) if I could use the integer data type? This one uses only four bytes, and this is the field type I use for my primary keys (for most tables).

Of course, if you only need a two-digit integer, numeric would use less space than Integer. Otherwise, I seldom use numeric, since it can often be replaced with Integer, Double, or Currency, depending on the situation.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform