10 Replies Latest reply on Feb 8, 2010 7:55 AM by mrvodka

    Primary Key Data Type

    MarieT

      Title

      Primary Key Data Type

      Post

      I am new at FMP 10 and want to understand why when you create a Primary Key that is an auto generated seriel number the data type used is text?  That makes no sense to me since the type is obviously a number. 

       

      I am referring to all of the pre-made fmp examples that come with 10.

      It makes sense to me that the data type would be number so that it could be indexed and sorted as a number.  The data Type of text does not do that.  Help.  What don't I understand?

       

      My friends who write SQL databases tell me NEVER make a Primary Key text.   HELP????

        • 1. Re: Primary Key Data Type
          mrvodka
            

          First FileMaker has VERY loose data types. You can enter text in a number field if you so choose unless you dont allow it in the validation.

           

          The default type when you create fields is set to text.

           

          As for the sample databases having text serial ID key fields, I would guess that it may have been possibly laziness or carelessness.

           

          • 2. Re: Primary Key Data Type
            MarieT
              

            Are you saying then that it is BEST PRACTICE to use number data type?

            Do you see any problem with me changing from text to number?

            • 3. Re: Primary Key Data Type
              mrvodka
                

              No there shouldnt be an issue for you. Once could have text key fields. However, when dealing with incrementing serial fields, then it should be number.

               

               

              • 4. Re: Primary Key Data Type
                philmodjunk
                  

                Another reason for keeping numbers in number fields:

                 

                Numbers sort like numbers and text sorts like text.

                 

                Numbers in a text field will sort like this (ascending): 1, 10, 2, 30, 9 ...

                • 5. Re: Primary Key Data Type
                  MarieT
                    

                  Thanks for the clear and "to the point" answer I was seeking.

                  I like reading your posts because you get right to it without a lot of extraneous babble like some "helpers".  Thanks for that!

                   

                  I've been working for a week trying to create a script for a simple pdf but have gone in circles reading thousands of posts and trying everything in the book.  Can you look at this and see where my problem is?

                   

                  I want to save the records being browsed to a file on the desktop.  Shouldn't be hard. All the example keep telling me to call it "test.pdf" but I'm saving 500 letters and want them to be saved by full name.  What is wrong with this?

                  file:VNSA /TempPDF/Confirmation & Workers::FullName Reversed.pdf

                  when I want the file to read Confirmation and then the worker's name reversed?  (table is Worker, field is FullName Reversed)

                  In the TempPDF file it saves it but calls it Confirmation & Workers--FullName Reversed.pdf

                  DUH???  What do I need to insert to get it to pull the info from the table?

                   

                  Secondly I tell it to send mail using client and attach the file file:VNSA /TempPDF/Confirmation & Workers::FullName Reversed.pdf

                  but it does NOT attach it.

                  HELP.

                   

                  Thanks in advance!

                  • 6. Re: Primary Key Data Type
                    mrvodka
                      

                    Slopearoonie wrote:

                    Thanks for the clear and "to the point" answer I was seeking.

                    I like reading your posts because you get right to it without a lot of extraneous babble like some "helpers".  Thanks for that!

                     


                    Every question that you posted was answered by babbling.


                    • 7. Re: Primary Key Data Type
                      MarieT
                         I am sorry that I hurt your feelings but I wish you would just answer the question and quit trying to prove how smart you are.  I know you're smarter than I or I wouldn't be asking for your help.
                      • 8. Re: Primary Key Data Type
                        RickWhitelaw
                          

                        Keep in mind . . . Mr_Vodka answered your posts as well! I don't believe he was being "pointed". 

                         

                        RW 

                        • 9. Re: Primary Key Data Type
                          LaRetta_1
                            

                          Slopearoonie wrote:
                          I am sorry that I hurt your feelings but I wish you would just answer the question and quit trying to prove how smart you are.  I know you're smarter than I or I wouldn't be asking for your help.

                          Well, for goodness sakes, there is no need to be rude.  People here answer as best they can.  Many people appreciate more detailed explanations and additional input to help others see the perspective. We have no way of knowning your skill level or background so we do the best we can with (usually the very small amount of input we receive from the person posting). 


                          • 10. Re: Primary Key Data Type
                            mrvodka
                              

                            Slopearoonie wrote:
                            I am sorry that I hurt your feelings but I wish you would just answer the question and quit trying to prove how smart you are.

                            Far from it and wrong on both counts. If you ask open ended questions and dont like the responses then I guess that's on you.

                             

                            Like I said earlier, all of your questions were answered.

                             

                             


                            Slopearoonie wrote:

                            I am new at FMP 10 and want to understand why when you create a Primary Key that is an auto generated seriel number the data type used is text?  That makes no sense to me since the type is obviously a number. 

                             



                            mr_vodka wrote:

                             

                            The default type when you create fields is set to text.

                             


                             
                             

                            Slopearoonie wrote:

                            I am referring to all of the pre-made fmp examples that come with 10.

                            It makes sense to me that the data type would be number so that it could be indexed and sorted as a number.  The data Type of text does not do that.  Help.  What don't I understand?

                             



                            mr_vodka wrote:

                             

                            As for the sample databases having text serial ID key fields, I would guess that it may have been possibly laziness or carelessness.

                             


                             

                             


                            Slopearoonie wrote:

                            My friends who write SQL databases tell me NEVER make a Primary Key text.



                            mr_vodka wrote:

                            First FileMaker has VERY loose data types. You can enter text in a number field if you so choose unless you dont allow it in the validation.

                             

                            This was for your SQL friends.


                             

                             


                            Slopearoonie wrote:

                            Do you see any problem with me changing from text to number?



                            mr_vodka wrote:
                            No there shouldnt be an issue for you.

                             

                             


                            Slopearoonie wrote:

                            Are you saying then that it is BEST PRACTICE to use number data type?



                            mr_vodka wrote:
                            One could have text key fields. However, when dealing with incrementing serial fields, then it should be number.