在sql server 2000下可以
create table tbl
(
oid uniqueidentifier
)
insert tbl(oid) values(newid())
请问Oracle下的GUID是怎么样的,
因为需要数据结构支持多数据库
create table tbl
(
oid uniqueidentifier
)
insert tbl(oid) values(newid())
请问Oracle下的GUID是怎么样的,
因为需要数据结构支持多数据库
调试欢乐多
insert into tbl(id,....)
values (your_seq.nextval,....)
方法一:
用触发器建一个序列
create sequence a_seq increment by 1 start with 100;
建一个触发器
create or replace trigger t_a
before insert on a
for each row
begin
select s_a.nextval into :new.b from dual;
end;方法二:
建一个序列
create sequence a_seq increment by 1 start with 100;
使用
insert into tbl(id,....)
values (a_seq.nextval,....)
UPDATE locations SET uid_col = SYS_GUID();
SELECT location_id, uid_col FROM locations;
LOCATION_ID UID_COL
----------- ----------------------------------------
1000 7CD5B7769DF75CEFE034080020825436
1100 7CD5B7769DF85CEFE034080020825436
1200 7CD5B7769DF95CEFE034080020825436
1300 7CD5B7769DFA5CEFE034080020825436
...