But that would not make it unique I would not think.

However if you have a DB, simply have a table and increment
the field by one each time you need a unique ID.

Field 1:  ID (Autonumber) (seed 1000)
Field 2: Prefix (text) example "CT"

Then use 

#Prefix#-#Numberformat(ID,"000000")#

Something like that anyway



>>> [EMAIL PROTECTED] 03/17/03 08:18AM >>>
if you mean a UUID within SQL (i.e. 46 chr string such as
A4534-34565E-
etc...) then you may be able to use newid() within mySQL, though I am
not
sure that it supports it.

In CF, you could use : myUUID = Mid(CreateUUID(),1,4); to get the first
4
chars of a CF generated ID.

HTH

Neil

-----Original Message-----
From: Tangorre, Michael [mailto:[EMAIL PROTECTED] 
Sent: 17 March 2003 13:04
To: CF-Talk
Subject: RE: Using createUUID()


Use the current date and add random numbers to the end:

03172003nn where 'nnn' are the random numbers.

To be honest with you... UUID is the way to go though, but this should
work.

#DateFormat(now(),"mmddyyyy")##Rand()##Rand()#




-----Original Message-----
From: FlashGuy [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 17, 2003 7:56 AM
To: CF-Talk
Subject: Using createUUID()


Hi,

I need to generate a unique ID for every form I submit. The createUUID
#
generated is just too long for my needs. My ID only needs to be 10
characters in length. Something like:

CT-0001001

I'm using MySQL. Can I have mysql generate the unique ID? How could I
do
this with CF?




---------------------------------------------------
Colonel Nathan R. Jessop
Commanding Officer
Marine Ground Forces
Guatanamo Bay, Cuba
---------------------------------------------------






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to