CREATE OR REPLACE FUNCTION "fn_GenGUID" RETURN VARCHAR2
IS
   GUID VARCHAR2(38);
BEGIN
   GUID := SYS_GUID();
   RETURN    '{'
          || SUBSTR (GUID, 1, 8)
          || '-'
          || SUBSTR (GUID, 9, 4)
          || '-'
          || SUBSTR (GUID, 13, 4)
          || '-'
          || SUBSTR (GUID, 17, 4)
          || '-'
          || SUBSTR (GUID, 21, 12)
          || '}';
END "fn_GenGUID";
/
