文章詳情頁
oracle自動生成uuid的實現(xiàn)方法
目錄
- oracle自動生成uuid方法
- 1.創(chuàng)建一個表
- 2.生成uuid的語句
- 3.添加幾條數(shù)據(jù),查詢就可以看到效果
- oracle獲取UUID亂碼
oracle自動生成uuid方法
1.創(chuàng)建一個表
create table t_user(id varchar2(200),name varchar2(200));
2.生成uuid的語句
alter table t_user modify id default sys_guid();update t_user set id = sys_guid();
3.添加幾條數(shù)據(jù),查詢就可以看到效果
insert into t_user(name) values(pluto);insert into t_user(name) values(charon);commit;select * from t_user;
oracle獲取UUID亂碼
SELECT sys_guid(),rawtohex(sys_guid()) from dual;
使用sys_guid()獲取oracleUUID,會出現(xiàn)亂碼問題,使用庫函數(shù)對sys_guid()進行處理,則是標準UUID
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持。
標簽:
Oracle
排行榜
