Doahh Doahh - 7 months ago 18
SQL Question

MySQL random string longer than 32 characters

I am trying to generate a 36 character random string in MySQL using:

UPDATE my_table SET entity_uid = substring(MD5(RAND()) FROM 1 FOR 36);


but the result is always a 32 character string. Is there a way to get a longer string?

Answer
UPDATE my_table SET entity_uid = UUID();