SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Oracle equivalent for SQL Server TIMESTAMP/ROWVERSION?


Oracle equivalent for SQL Server TIMESTAMP/ROWVERSION?

Author
Message
Pam Brisjar
Pam Brisjar
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4854 Visits: 2804
Working on an app that needs to run in both SQL Server and Oracle. I want to be able to use the timestamp/rowversion data type as found in SQL Server (NOT the SQL-2003 timestamp data type). Is there an Oracle equivalent?

To refresh your memory, this is timestamp in SQL Server...
"Each database has a counter that is incremented for each insert or update operation that is performed on a table that contains a timestamp column within the database. This counter is the database timestamp. This tracks a relative time within a database, not an actual time that can be associated with a clock. A table can have only one timestamp column. Every time that a row with a timestamp column is modified or inserted, the incremented database timestamp value is inserted in the timestamp column. "

Thanks.
Ivyflora
Ivyflora
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 15
In Oracle i am using ORA_ROWSCN function instead of SQL SERVER's Timestamp...
Its very easy to use..
When you create a table you can add ROWDEPENDENCIES command.
For Example...



SQL> CREATE TABLE TEST001(
2 TESTID NUMBER,
3 TESTNAME VARCHAR2(25))
4 ROWDEPENDENCIES;

Table created.

SQL>
SQL> INSERT INTO TEST001 VALUES(1,'DEMO');

1 row created.

SQL> COMMIT;

Commit complete.

SQL> select ORA_ROWSCN,TESTID,TESTNAME from TEST001;

ORA_ROWSCN TESTID TESTNAME
---------- ---------- -------------------------
5066802 1 DEMO

SQL>
SQL> update TEST001 set TESTNAME = 'TEST' WHERE TESTID = 1;

1 row updated.

SQL> COMMIT;

Commit complete.

SQL> select ORA_ROWSCN,TESTID,TESTNAME from TEST001;

ORA_ROWSCN TESTID TESTNAME
---------- ---------- -------------------------
5066883 1 TEST



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search