Get a Jumpstart with our Sample Apps
Results 1 to 9 of 9

Thread: Truncated Field Names in Duplicated Tables

  1. #1
    Elgin Hakala
    Guest

    Default Truncated Field Names in Duplicated Tables

    When duplicating tables, I get truncated field names, ie "email_address" is shortened to "email_addr". Why is this and is there anything I can do to prevent it?
    Thanks in advance for any input.

    Elgin

  2. #2
    "Certified" Alphaholic glenschild's Avatar
    Real Name
    Glen Schild
    Join Date
    Apr 2000
    Location
    Frome, Somerset, UK
    Posts
    1,403

    Default RE: Truncated Field Names in Duplicated Tables

    Elgin

    Probably something to do with a dbf restriction on names, maxiumum 10 characters long. It is a good habit to restrict field names to this maximum length to prevent such problems.

    Regards

    Glen Schild

  3. #3
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,298

    Default RE: Truncated Field Names in Duplicated Tables

    Elgin,

    Apparently the original dBase format limits fieldnames to 10 chars in width. Alpha Five uses FoxPro 2.6 formatted DBF's and FoxPro inherited the dBase format, so the restriction still applies. Yet, Alpha Five permits longer fieldnames. How? By storing the long fieldnames in the dictionaries for each table. In this manner DBF compatibility is achieved, while permitting longer fieldnames within the Alpha Five environment.

    To preserve your longer fieldnames you need to duplicate the dictionaries as well as the DBF's.

    If you open a DBF with a non-Alpha Five product you'll be unable to open the dictionaries, so you just see the first 10 chars of the long fieldnames, since that's all that's present in the DBF file itself.

    Hope this helps explain what's going on.

    -- tom

  4. #4
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Truncated Field Names in Duplicated Tables

    Elgin,

    In line with Tom's advice, if you duplicate a table within A5 you keep your field names because the dictionaries are automatically duplicated. I venture that you duplicated the dbf files in explorer and then lost the long fieldnames because alpha created a new dictionary based on the dbf and had only the 10 characters to go by.

    So you can duplicate tables in explorer and make sure to duplicate the dictionary files or duplicate from within A5 and not have to remember anything.

    I work from within A5.

    Bill

  5. #5
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,752

    Default RE: Truncated Field Names in Duplicated Tables

    Bill, I have to disagree on that one. I think you've been doing it out of habit for too long. (I'm assuming A5v4.5 here since v5 isn't officially out yet. I haven't checked v5.)

    If you build a new "copy records" operation, the default is to NOT copy the data dictionaries. (At least it is on my system.) To copy the data dictionaries when using the genie, just select the option when presented. When working directly from the Copy Card, go to "Edit/Properties" on the menu.

    If you run the "duplicate" option on a table, you are presented with a dialog box in which you can check whether to duplicate the records, indexes, and/or data dictionaries.

  6. #6
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Truncated Field Names in Duplicated Tables

    Hi Cal,

    I believe we may be talking about two different things within alpha: you about xbasic and operations; me about interacting with the control panel.

    I just went to the control panel and selected a table with a bunch of long file names:
    -right click
    -select duplicate
    -didn't select *any* options from the box (no records, no fieldrules, no layouts, no nothin')
    -clicked ok

    The copy of the original table preserved its long field names.

    Bill

  7. #7
    Elgin Hakala
    Guest

    Default RE: Truncated Field Names in Duplicated Tables

    Bill,

    That's strange... It is not so with the version I use (v4). I am duplicating in alpha five using the duplicate table option, not in explorer or using a copy records operation. Ah well, a bug that can be worked aroud. Thanks for the input gents!

    Elgin

  8. #8
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,752

    Default RE: Truncated Field Names in Duplicated Tables

    We learn something new every day Bill! I took your comment "because the dictionaries are automatically duplicated" a bit too literally.

    I ran some tests and found that Alpha does indeed copy (create?) data dictionaries automatically BUT they do not copy any of the user defined field rules unless the user specifies the "copy data dictionaries" option. Probably Alpha did this because they recognized the need to do so in order to get the long field names into the new copy!?

  9. #9
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Truncated Field Names in Duplicated Tables

    Hi all,

    Cal took me literally but I expressed myself with insufficient precision. I should have written something like the following:

    The component of the dictionary files holding the long names is automatically copied in a duplicate from within alpha. Additional components may be copied depending on the options checked.

    Bill

Similar Threads

  1. Truncated Field Names
    By djones092 in forum Alpha Five Version 5
    Replies: 6
    Last Post: 04-30-2003, 08:37 AM
  2. Letters in duplicated tables don't work
    By richardb in forum Alpha Five Version 4
    Replies: 5
    Last Post: 11-10-2002, 11:24 AM
  3. Truncated Field Names (:<<((((
    By forskare in forum Alpha Five Version 4
    Replies: 5
    Last Post: 05-05-2002, 05:54 AM
  4. Truncated index names?????
    By Tommy in forum Alpha Five Version 4
    Replies: 16
    Last Post: 08-23-2001, 09:33 PM
  5. Dublicating tables truncates field names
    By Lawrie in forum Alpha Five Version 4
    Replies: 1
    Last Post: 02-16-2001, 12:08 PM

Posting Permissions

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