Alpha Video Training
Results 1 to 11 of 11

Thread: Database Tablename Naming

  1. #1
    Member
    Real Name
    Paul Main
    Join Date
    Feb 2005
    Location
    Bucks, UK
    Posts
    206

    Default Database Tablename Naming

    Hi,

    Can someone advise about how long a table name should be. Or atleast how long it should not be. Is there a specific lenght over which problems can occur. I favour naming a table as a description say 20 chars. If this is wrong then I can save myself a lot of problems by having an answer.

    Are there any guidelines documented anywhere in Alpha 5.

    Your advise please.

    Paul

  2. #2
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: Database Tablename Naming

    Paul,

    Often spoken guidelines:
    1. The shortest to achieve description
    2. Uniqueness within the first 10 characters.
    3. Practally speaking- If you are writing code, you will be typing table names often and the longer they are, the more you have to type and the more you type it wrong.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  3. #3
    Member
    Real Name
    Doug Page
    Join Date
    Jan 2002
    Location
    Vancouver, BC Canada
    Posts
    963

    Default Re: Database Tablename Naming


  4. #4
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    6,026

    Default Re: Database Tablename Naming

    Make those names and all names as short as you can handle. We did a 15 table program where all the tables were 2 letters long.

    The calc fields will only hold so many characters and if you use 20 character table and field names, it will severely hamper your calcs. Like 20 times 10 insertions = 200 gone from 255. Not much room for a function.

    Dave

  5. #5
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Database Tablename Naming

    Quote Originally Posted by DaveM View Post
    Make those names and all names as short as you can handle. We did a 15 table program where all the tables were 2 letters long.

    The calc fields will only hold so many characters and if you use 20 character table and field names, it will severely hamper your calcs. Like 20 times 10 insertions = 200 gone from 255. Not much room for a function.

    Dave
    Dave,

    I believe the limit on calculated field expressions is 1024 characters.

    Database Specifications
    Expressions
    Number of characters in an expression
    1024
    Have you run into a situation where you couldn't create a calculated field expression more than 255 characters long?

    I do agree with the procedure of keeping table and field names as short as possible.

  6. #6
    VAR davej's Avatar
    Real Name
    Dave Jampole
    Join Date
    Apr 2000
    Location
    Haughton, LA ( just east of Shreveport, Louisiana)
    Posts
    2,524

    Default Re: Database Tablename Naming

    Paul,

    Quote Originally Posted by Paul Main View Post
    Can someone advise about how long a table name should be. Or atleast how long it should not be. Is there a specific lenght over which problems can occur. I favour naming a table as a description say 20 chars. If this is wrong then I can save myself a lot of problems by having an answer.
    Keep your table names within a 10 character limit. Balance that with meaningful names. At the recent conference, some of us participated in a 'best practices' session and the consensus was that adopting a naming convention that is meaningful and works for you is one of the best investments you could make. Cal's naming convention is different than mine, which is probably different than the next person's. Adopting a naming convention is the important key.

    As Cal mentions, exceeding the 10 character limit can sometimes cause problems, so you are better off not tempting Mother Nature. While Dave Mason uses 2-character names, I personally wouldn't go that short, but if it works . . .

    Dave
    Dave Jampole
    www.customalpha.com

    Women and cats will do whatever they want. The sooner men and dogs realize that, the happier they will be.


  7. #7
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default Re: Database Tablename Naming

    While the 10-character limit is highly recommended for field names and indicies, I don't think that cautionary advice need apply to table (or set) names. However, it is advisable to not use spaces in tables names, but rather, underscores.

  8. #8
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: Database Tablename Naming

    What I find somewhat disconcerting is that Alphasport and other template examples that Alpha provides do not adhere to these 'vocalized' recommendations. What's with that? Are we all wrong, or are the Alpha folks bad developers?
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  9. #9
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default Re: Database Tablename Naming

    My reading is that Alpha feels they have "fixed" the problem. However, field names & indicies will still be truncated if the dbf is opened w/o benefit of the data dictionary files.

  10. #10
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    6,026

    Default Re: Database Tablename Naming

    Stan,

    You are correct by the book. I was thinking of something else and possibly older versions. However, I can't seem to get 1023 fields into a table(never could) and the 2,000,000,000 records can never happen on my computers because the tables quit at 2 gig. Fpt files are done at 2 gig also, then they corrupt to the point I am looking for alternatives.

    I would still recommend short names across the whole app( just like ya'll do) and short as possible calculations. There is less room for error later.

    Dave

  11. #11
    Member
    Real Name
    Paul Main
    Join Date
    Feb 2005
    Location
    Bucks, UK
    Posts
    206

    Default Re: Database Tablename Naming

    Many thanks everyone for a comprehensive reply.

    Paul

Similar Threads

  1. Naming Conventions
    By Fletch in forum Alpha Five Version 5
    Replies: 7
    Last Post: 02-17-2007, 11:34 AM
  2. TableName-> vs. ptr.
    By CALocklin in forum Alpha Five Version 6
    Replies: 4
    Last Post: 04-03-2005, 09:49 AM
  3. naming
    By Bruce Peaslee in forum Alpha Five Version 5
    Replies: 4
    Last Post: 01-28-2003, 07:48 PM
  4. Re-Naming Letters
    By Aadkins101 in forum Alpha Five Version 5
    Replies: 1
    Last Post: 08-05-2002, 11:53 AM
  5. FILE NAMING
    By Joe DeFalco in forum Alpha Five Versions 2 and 3
    Replies: 2
    Last Post: 04-12-2001, 07:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •