Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006

    Unanswered: Multiple timestamps

    I am using MySQL 5.0.22 and am trying to make multiple timestamps. One for when the record is inserted and one for when the record is updated.

    Here is my structure:

    create table requests (
    id int not null primary key auto_increment,
    employee varchar(50) not null,
    category varchar(50) not null,
    priority varchar(10) not null,
    description text not null,
    status varchar(10) not null default 'Open',
    submitted timestamp not null default current_timestamp,
    completed timestamp not null default current_timestamp,
    technician varchar(50) not null
    Here is the error:

    ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP
    column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
    Is there any way to accomplish this? I tried reading the reference manual on this and I thought I was doing it right but I guess not. Thanks!

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    put the timestamp for updated first, and give it the ON UPDATE clause

    put the timestamp for inserted second, and populate it manually | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts