remove dash of UUID generated directly on MySQL

mysql, uuid

Solution

REPLACE(UUID(),'-','')

You don't need the UNHEX, just simply replace the hyphens.

Problem

I generate `UUID` using `INSERT INTO tbl1 (key, val) VALUES (UUID(), :value)` directly on MySQL using PDO. I don't have any idea how to remove those - (dashes) on MySQL side, on PHP side I can simply remove it using `str_replace()`.

Original source