How to generate random number UUID in ORACLE
select sys_guid() from dual;
SYS_GUID(), is a function provided after Oracle 8i. SYS_GUID generates and returns a globally unique identifier (original value) consisting of 16 bytes. On most platforms, the generated identifier consists of the host identifier, the process or thread identifier that executes the function, and a distinct value (byte sequence) for the process or thread.
Can be used to generate a unique identification ID;
---------------------------------------------------------------------------------------------------
mySQL method to generate random number UUID
The primary key of Zhang table is the uuid generated by the client program. Now we need to manually import a batch of data without uuid. The mysql statement generates UUID:
select uuid(); UUID with bars
select replace(uuid(), '-', ''); UUID with bars removed
Summary: mysql uses the UUID with the dashes removed. Otherwise it's too long.