Quote:
Originally Posted by write2ashokkumar hi,
how to get the unique random number and random string?
For example, i start the process to insert the data into the table,with the random value, at that time i need the unique value also.... how can we get this? Regards,
S.Ashokkumar |
we have a function in Mysql UUID() [Universal Unique Identifier].
A UUID is a 128-bit number represented by a string of five hexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:
* The first three numbers are generated from a timestamp.
* The fourth number preserves temporal uniqueness in case the timestamp value loses monotonicity (for example, due to daylight saving time).
* The fifth number is an IEEE 802 node number that provides spatial uniqueness
Code:
mysql> SELECT UUID();
-> '8dcc1548-dd6d-102a-bf08-0019d123ad2a'