Hello,
I am al little puzzled by the following:
> create table test_table(id number(10), guid varchar2(32));
table TEST_TABLE created.
> insert into test_table(id,guid) values (1,null);
1 rows inserted.
> insert into test_table(id,guid) values (2,null);
1 rows inserted.
> insert into test_table(id,guid) values (3,null);
1 rows inserted.
> update test_table set guid=sys_guid();
3 rows updated.
> select * from test_table;
ID GUID
---------- --------------------------------
1 0006694068E012E1E05383153C0A9B5C
2 0006694068E112E1E05383153C0A9B5C
3 0006694068E212E1E05383153C0A9B5C
> drop table test_table;
table TEST_TABLE dropped.
So why do I get the same GUID in each row? Is Oracle lazy by only calling sys_guid() just once and then use it for all rows?
I want unique guid's. What is the best solution?
I am using Oracle XE 11g on a Windows machine.