您可以使用SYS_GUID()函数在insert语句中生成GUID:
insert into mytable (guid_col,data) values (sys_guid(),'xxx');
用于存储GUID的首选数据类型为RAW(16)。
正如Gopinath回答:
select sys_guid() from dual union all select sys_guid() from dual union all select sys_guid() from dual
你得到
88FDC68C75DDF955E040449808B55601
88FDC68C75DEF955E040449808B55601
88FDC68C75DFF955E040449808B55601
正如托尼·安德鲁斯所说,只有一个字符不同
88FDC68C75DDF955E040449808B55601
88FDC68C75DEF955E040449808B55601
88FDC68C75DFF955E040449808B55601
也许有用:http://feuerthoughts.blogspot.com/2006/02/watch-out-for-sequential-oracle-guids.html