Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Don Read
On 19-Jun-2003 Mojtaba Faridzad wrote: Please don't hi-jack threads. > Hi, > > In a docuement such as Invoice Form, we have a header and a couple of > records for the detail. In header table, Invoice# can be the PRIMARY KEY > but > in detail table, Invoice# is not unique. I think there are two

Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Ken Menzel
Hi Paul, (good to hear from you!) We use (invoice number+date) number as the primary key for the header and (invoice number+body item number+date) in the body of the invoice. We do not allow the same invoice number to be reused on the same day. However they can eventually rollover (ours is a

Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Mojtaba Faridzad
ay, June 19, 2003 11:43 AM Subject: Re: selecting PRIMARY KEY when there is no unique value > Mojtaba Faridzad wrote: > > >Hi, > > > >In a docuement such as Invoice Form, we have a header and a couple of > >records for the detail. In header table, Invoice# can be the

Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Paul DuBois
At 11:15 -0400 6/19/03, Mojtaba Faridzad wrote: Hi, In a docuement such as Invoice Form, we have a header and a couple of records for the detail. In header table, Invoice# can be the PRIMARY KEY but in detail table, Invoice# is not unique. I think there are two solutions to choose a Primary Key (i

Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Michael Conlen
Mojtaba Faridzad wrote: Hi, In a docuement such as Invoice Form, we have a header and a couple of records for the detail. In header table, Invoice# can be the PRIMARY KEY but in detail table, Invoice# is not unique. I think there are two solutions to choose a Primary Key (in MyISAM type) : 1) Add

Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread PeterWR
Hi, >From my point of view, you should always add a autoincrement_field for having a unique identifier and keeping each record unique, ex. in case of programmingmistakes and so. Best regards Peter - Original Message - From: "Mojtaba Faridzad" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>

Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Bruce Feist
Mojtaba Faridzad wrote: In a docuement such as Invoice Form, we have a header and a couple of records for the detail. In header table, Invoice# can be the PRIMARY KEY but in detail table, Invoice# is not unique. I think there are two solutions to choose a Primary Key (in MyISAM type) : 1) Adding a

RE: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Mike Hillyer
When I last did an invoice-type project, he had the header table with an invoice# as PRIMARY KEY, then we had an invoice_line table with a rowid PRIMARY KEY as auto-increment and a invoice# with a non-unique key INDEX. This worked fine for our purposes, so I would probably go with option #1 I guess