Oracle equivalent of SQL Server timestamp data type [message #185818] |
Thu, 03 August 2006 14:19 |
zaslavets
Messages: 5 Registered: August 2006
|
Junior Member |
|
|
Hi
I have a SQL server database where columns of timestamp datatype play very important role. Since timestamp is binary version of (global, unique within database) integer growing incrementally, new value is assigned to row every time it is updated/inserted.
Such columns allow to watch for inserts,updates of data incrementally on row level very precisely.
I am working on migration from SQL to Oracle.
Is there anything like timestamp column in oracle? What technique is used in oracle for similar purpose?
Thanks
Denis
|
|
|
|
|
Re: Oracle equivalent of SQL Server timestamp data type [message #185844 is a reply to message #185818] |
Thu, 03 August 2006 17:10 |
zaslavets
Messages: 5 Registered: August 2006
|
Junior Member |
|
|
timestamp in SQL server is like sequence. it is very precise. It is qunique withing database, it is impossible to have 2 rows with the same value. Does timestamp in oracle provide the same feature?
For example if I update 2 rows in table in the same query,
update a
set ts = sysdate
where id in (1,2);
will they always have different timestamp?
Thanks
Denis
|
|
|
|
|
|
Re: Oracle equivalent of SQL Server timestamp data type [message #185854 is a reply to message #185853] |
Thu, 03 August 2006 17:52 |
zaslavets
Messages: 5 Registered: August 2006
|
Junior Member |
|
|
I did testing:
create table t (id number, ts timestamp default systimestamp);
insert into t (id) values (1);
insert into t (id) values (2);
insert into t (id) values (3);
commit;
select * from t;
update t set id = id+10 , ts = systimestamp;
commit;
select * from t;
As you can see, if statements for every row are separate, timestamp is unique, If we do update in 1 query, it is not.
|
|
|
|
|