We try to move a SQLServer application to ORACLE, but can not find the
functionality of SQLServer's timestamp column in Oracle, i.e. AUTOMATIC
update of a column to a unique value.
I find it very surprising that Oracle lacks this fundamental
Client/Server functionality.
The best solution, I can think of, in Oracle, is to declare a timestamp
column of datatype long (we do not need the time) and have an update
trigger on the column that will increase it by 1 for every update. A
DATE column (and SYSDATE) is not enough since we can have more than one
update per second. The update trigger will cause a mutating error if you
don't put some secret(=not in the manuals) code in the trigger.
Our application programs use the timestamp column to reduce number of
packages sent over the network. (UPDATE XXX Customer WHERE szCustomer =
'xx' AND timestamp = xxx). Without it we must read and lock the record
before updating to be sure that the record has not been changed by
another user.
Anyone knows a better solution?
Any hints appreciated!
Joakim Lundberg
joakiml_at_noventus.se