Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

KDavie (Programmer) (OP)
18 Feb 04 20:02
I am in the process of designing a database and am having trouble deciding on the appropriate width for some of my character data-type fields.

If I am not mistaken, VFP will truncate data if the field-width is not sufficient enough to store it.  If the  field-width is greater than the number of characters needed, then it will still use the same amount of space as it would if it were populated to capacity.  Obviously, losing data isn't an option, but I don't want to use a bunch of unnecessary space either.

Does anyone have a method of choosing the appropriate field-width they can share with me?  Am I worrying about nothing?  Any help would be appreciated.

Thanks,

-Kevin
BPeisch (Programmer)
18 Feb 04 20:13
The answer really depends on your situation.  If the length of the data varies widely, then you'd be better off using a memo field.  If most of the time, the data will be near a set maximum, then a character string would be the best bet.


  -BP (Barbara Peisch)
  www.peisch.com

KDavie (Programmer) (OP)
18 Feb 04 20:28
To better illustrate my situation, here are some of the fields I am concered with:

cLastName
cAddress
cCity
cBankName

While most last names aren't over, let's say 12 characters, there is bound to be an instance where the last name is more than 12 characters.  I'm fairly confident that no name would be more than 20 characters, but if I use that as the field-width then I am basically using twice as much space as I really need to for most of my data.  The same applies for the other fields.

Thanks for your help,

-Kevin

BPeisch (Programmer)
18 Feb 04 20:35
I wouldn't worry about the extra spaces for fields like this.  I usually use 30 character fields for names, addreses, cities, etc.


  -BP (Barbara Peisch)
  www.peisch.com

KDavie (Programmer) (OP)
18 Feb 04 20:38
Thanks Barbara,

I thought I might be worrying about nothing!

-Kevin
MikeLewis (Programmer)
19 Feb 04 4:34
Kevin,

This won't help much, but you might like to know that the next release of VFP will support variable-length character fields, in the same way that SQL Server does.

In the meantime, I'd agree with Barbara that this isn't worth worrying about. We all have names, addresses, etc in our tables, and it is not seen as a big issue.

Mike

Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site:   www.ml-consult.demon.co.uk
My Crystal Reports web site:   www.ml-crystal.com

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close