MySQL Forums
Forum List  »  Newbie

"On Update" behaviour - default value on update
Posted by: Ste Hodges
Date: December 02, 2010 03:49PM

I've searched for an answer but can't find one relating to this.

I store data in a database that is to be accessed every hour from a third party app. This app looks for a value in an integer column (-1 if its a new record, 0 if its updated, 1 if the app has already seen it).

I want to be able to set the value of this column as and when updates are applied to rows.

I've set -1 as the default so any new rows get -1 (and the third party app therefore finds the record) but I want to set the column to 0 on every update (so the app knows its changed).

This is similar to "on update" but I think this can only be applied to a timestamp?

Is creating a trigger the only route? Can anyone help?

Thanks in advance.

Options: ReplyQuote


Subject
Written By
Posted
"On Update" behaviour - default value on update
December 02, 2010 03:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.