SQL Language (MOSC)

MOSC Banner

Equivalent of generated always from DB2 UDB in Oracle 12.x

edited May 16, 2017 5:01AM in SQL Language (MOSC) 4 commentsAnswered ✓

We're migrating several databases from DB2 UDB 9.7 to Oracle 12.1 or 12.2

In DB2 , a lot of columns have this syntax:

  TMS_MAJTIMESTAMPNOT NULLGENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP

That means that column tms_maj will be updated at insert time and on each update of any columns from that row

The only way to do this in Oracle would be to use the default sysdate in the column definition  and using an after-update trigger on the row,

I did not find a way to avoid the trigger , any other ideas ?

Thanks,

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center