How to auto update date column without using trigger
Hi,
How to write below MYSQL query in Oracle 10g :
CREATE TABLE example_timestamp (
Id number(10) NOT NULL PRIMARY KEY,
Data VARCHAR(100),
Date_time TIMESTAMP DEFAULT current_timestamp on update current_timestamp
);
I need to auto update the Date_Time column without using trigger when ever i update a record.
Example shown below is from MYSQL. I want to perform the below steps in ORACLE to auto update Date_Time column.
mysql> INSERT INTO example_timestamp (data)
VALUES ('The time of creation is:');
mysql> SELECT * FROM example_timestamp;
-------------------------------------------------------------------
| id | data | Date_Time |
-------------------------------------------------------------------
| 1 | The time of creation is: | 2012-06-28 12:37:22 |
--------------------------------------------------------------------
mysql> UPDATE example_timestamp
SET data='The current timestamp is: '
WHERE id=1;
mysql> SELECT * FROM example_timestamp;
-----------------------------------------------------------------------
| id | data | Date_Time |
-----------------------------------------------------------------------
| 1 | The current timestamp is: | 2012-06-28 12:38:55 |
-----------------------------------------------------------------------
Regards,
Yogesh.