On Tue, 7 Oct 2003 16:48:55 -0400, Jim wrote
> I need to be able to 'delete' records from table(s) but still
> maintain their information for an audit trail.
> I'd rather not have a field for a deleted flag and have to condition
> all the queries on the table on the state of this flag.
> Is it possible to move a record from one table to another easily?
> Even better, can I do it opaquely (without knowledge of the columns)?
> "move from LiveUsers to DeletedUsers where ID=?;"
> where all the fields in the first table get moved to the
> corresponding field of the 2nd. (If this is possible, what happens
> with autoincrement, timestamp fields?)
In the second table (DeletedUsers you don't define the ID autoincrement.
Timestamp you can freeze, and you can try.
From ducumentation I cut for You:
Let MySQL set the column when the row is created. This will initialise it to
the current date and time.
When you perform subsequent updates to other columns in the row, set the
TIMESTAMP column explicitly to its current value.
> Thanks for the help; I hope it isn't a trivial question.
> I'm new at this; I didn't find anything on moving records in the list
> Jim Cant
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?