当前位置:数据库 > Oracle >>

Oracle用function生成UUID方法

Oracle用function生成UUID方法
 
Sql代码  
CREATE OR REPLACE FUNCTION get_uuid  
RETURN VARCHAR  
IS  
guid VARCHAR (50);  
BEGIN  
guid := lower(RAWTOHEX(sys_guid()));  
RETURN  
substr(guid,1,8)||'-'||substr(guid,9,4)||'-'||substr(guid,13,4)||'-'||substr(guid,17,4)||'-'||substr(guid,21,12);  
END get_uuid;  
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,