Home » SQL & PL/SQL » SQL & PL/SQL » default value on update in oracle 11G (Oracle 11G , Windows 7)
default value on update in oracle 11G [message #638900] Thu, 25 June 2015 02:53 Go to next message
live4learn
Messages: 41
Registered: September 2013
Location: Bangalore, India
Member
Is there a similar feature in Oracle 11G as in Mysql..

https://docs.oracle.com/cd/E17952_01/refman-5.6-en/timestamp-initialization.html


CREATE TABLE t1 (
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
dt DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

My goal is to update a particular column to its current_timestamp whenever there is a update on the rows without using on update trigger.

Thanks !
Re: default value on update in oracle 11G [message #638902 is a reply to message #638900] Thu, 25 June 2015 03:21 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
No. You either use a trigger or modify all update statements to set those columns.
Re: default value on update in oracle 11G [message #638956 is a reply to message #638902] Fri, 26 June 2015 10:22 Go to previous message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
default is ONLY used for inserts. You need to use a trigger
Previous Topic: Date format help
Next Topic: Oracle Table last access detail
Goto Forum:
  


Current Time: Fri Apr 26 00:28:28 CDT 2024