Hi I wanted to update the LASTMODIFIED column when ever any row is updated. Your solution is perfect.
I am using hibernate and it sends null value which writes null value in the LASTMODIFIED column. Thanks for your help. Lule On Aug 20, 11:30 am, Thomas Mueller <[email protected]> wrote: > Hi, > > > When inserting a row > > How do you insert the row? Do you use: > > insert into resourcelisttype values(default, default); > or > insert into resourcelisttype(id) values(default); > > Both works for H2 according to my test. (Meaning, the timestamp is set.) > > Do you want to update the timestamp every time the row is inserted or > updated? In that case, use: > > CREATE TABLE RESOURCELISTTYPE(ID IDENTITY, LASTMODIFIED TIMESTAMP AS > CURRENT_TIMESTAMP); > > This is a 'computed column'. > > Regards, > Thomas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
