From Dwayne Wright PMP
Certified FileMaker Developer
A READER ASKS
I was reading your “FileMaker Thought Bucket” Blog. I have developed a FMP solution for our 3000 student school district. I am using Filemaker serial number generated primary keys. Sometimes I have used a number field and sometimes a text field. Your Blog says you prefer text fields. Is that a strong preference and what is your logic? Should I go back and change my number fields to text? I know that primary and foreign keys have to be of the same type to properly match
Well, part of the reason is pure muscle memory. I’ve been doing it that way for so long, that it is second nature to me. Here are some of the other reasons I use text values for my primary key fields.
1) When working on client databases and importing their data into the new database, I increment the first alpha character to a new value. So if the next primary key data string would have been D7341, I change it so the next value is E7341. Then when I look at the list view of my primary keys, I can easily see the records that were created after my last update.
2) Number characters can only go from 0 to 9 per character. In a text setup, I can use at least 30 characters per character (I avoid using O, I, L because they can look like 0 or 1). If I make the field case sensitive by changing the way the index of the field is stored, I can have even more unique character options per character position.
None of these reasons are very strong for going to text strings in primary key fields but I still do it nonetheless.
More info about the author and FileMaker in general, contact me at firstname.lastname@example.org.
© 2008 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.