List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 15 1999 2:52pm
Subject:Re: Unique ID Generation
View as plain text  
At 10:36 AM -0400 7/15/99, PinkeshP@stripped wrote:
>can anyone give me idea on generating unique id in the record?
>i was thinking of
>MINUTE(NOW())*SECOND(NOW())*HOUR(NOW())*DAYOFMONTH(CURDATE())*MONTH(CURDATE())
>*rand()*10
>
>is it safe enough to generate unique id like this?

No.  Since RAND() is random, there is no guarantee it will be unique,
although one would suppose it would be good enough.


Do you have some particular reason to not simply use an AUTO_INCREMENT
column?

--
Paul DuBois, paul@stripped
Thread
Unique ID GenerationPinkeshP15 Jul
  • Re: Unique ID GenerationPaul DuBois15 Jul
  • RE: Unique ID GenerationDon Read15 Jul
    • RE: Unique ID GenerationDon Read15 Jul
      • Re: Unique ID GenerationDaevid Vincent16 Jul
    • RE: Unique ID GenerationLincoln Yeoh16 Jul
  • Re: Unique ID GenerationDaevid Vincent16 Jul
  • Re: Unique ID GenerationDaevid Vincent16 Jul
Re: Unique ID GenerationKevin Smith15 Jul