Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Oracle equivalent for SQL Server TIMESTAMP/ROWVERSION? Expand / Collapse
Author
Message
Posted Thursday, January 8, 2009 4:53 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, May 1, 2014 7:26 AM
Points: 908, Visits: 2,804
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.
Post #632973
Posted Wednesday, February 25, 2009 10:41 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 28, 2009 4:22 AM
Points: 2, 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


Post #664794
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse