[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: Unique IDs
From:       "Joshua J. Kugler" <jkugler () bigfoot ! com>
Date:       2005-01-07 20:28:37
Message-ID: 200501071128.37351.jkugler () bigfoot ! com
[Download RAW message or body]

When I saw this message a few weeks ago, I *knew* MySQL had something for 
this, but I couldn't remember where I saw it, and I couldn't find it.  Today 
I found it.

Take a look at: http://dev.mysql.com/doc/mysql/en/Miscellaneous_functions.html
and scroll down to UUID()

Returns a Universal Unique Identifier (UUID) generated according to ``DCE 1.1: 
Remote Procedure Call'' (Appendix A) CAE (Common Applications Environment) 
Specifications published by The Open Group in October 1997 (Document Number 
C706). A UUID is designed as a number that is globally unique in space and 
time. Two calls to UUID() are expected to generate two different values, even 
if these calls are performed on two separate computers that are not connected 
to each other.

This was added in MySQL 4.1.2.  You didn't mention the version you were using, 
but 4.1 is production now.

Hope that helps!!

j----- k-----

On Monday 20 December 2004 05:33, Andrew Mull said something like:
> I'm working on a rather large database with many cross-linked tables
> currently using auto increment IDs.  The system is primarily a web based
> system, however, there will be times that the system will be run as a stand
> alone server...meaning no internet connection is available.
>
> The question arises that if someone enters information to the database on
> the website, while others are entering information on the local database,
> what is the best way to merge the data?  I would imagine that we would run
> into many duplicate auto increment IDs.
>
> I'm sure that for one table insert, this would not be a problem as I could
> store the SQL statement in a text file without the ID specified, and run it
> as a batch process on the live server when we get connectivity.  But I
> don't have a handle on how to update the sub tables that have a FK pointer.
>
> Any ideas?
>
> Thanks!
> -Andy

-- 
Joshua J. Kugler -- Fairbanks, Alaska -- ICQ#:13706295
Every knee shall bow, and every tongue confess, in heaven, on earth, and under 
the earth, that Jesus Christ is LORD -- Count on it!

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic