摘要:[Oracle][Identity] GUID對應 .NET GUID (Guid.NewGuid.ToString('D'))
-- Oracle GUID (32字元)
SELECT SYS_GUID() FROM DUAL
-- 結果
-- 2A2944AF85DB4C01A4C79C1F77C40FC5
-- Oracle GUID 對應 .NET GUID (36字元)
SELECT
SUBSTR(SYS_GUID(),7,2) ||
SUBSTR(SYS_GUID(),5,2) ||
SUBSTR(SYS_GUID(),3,2) ||
SUBSTR(SYS_GUID(),1,2) || '-' ||
SUBSTR(SYS_GUID(),11,2) ||
SUBSTR(SYS_GUID(),9,2) || '-' ||
SUBSTR(SYS_GUID(),15,2) ||
SUBSTR(SYS_GUID(),13,2) || '-' ||
SUBSTR(SYS_GUID(),17,4) || '-' ||
SUBSTR(SYS_GUID(),21,12)
FROM DUAL
-- 結果
-- AF44292A-DB85-014C-A4C7-9C1F77C40FC5