How to generate a version 4 (random) UUID on Oracle?

前端 未结 9 1098
野性不改
野性不改 2020-12-05 10:37

This blog explains, that the output of sys_guid() is not random for every system:

http://feuerthoughts.blogspot.de/2006/02/watch-out-for-sequential-orac

9条回答
  •  无人及你
    2020-12-05 11:27

    You can write a Java procedure and compile it and run it inside Oracle. In that procedure, you can use:

    UUID uuid = UUID.randomUUID();
    return uuid.toString();
    

    To generate desired value.

    Here's a link on how to compile java procedures in Oracle.

提交回复
热议问题