I want to alter a table to include modified
and created
columns. However, I am having trouble with adding the modified
column. I get the following error:
SQL Error: ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis"
I was reading this Oracle document (http://docs.oracle.com/cd/E17952_01/refman-5.5-en/timestamp-initialization.html) to get an example on how to properly write the ON UPDATE
syntax
Here is my SQL.
ALTER TABLE FOOBAR
ADD (
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
Why am I getting a missing right parenthesis error?
modified
so that it remains null when unmodified. And use afor each row
trigger to set:new.modified := systimestamp;
. – Colin 't Hart Jan 16 '14 at 13:22