List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 17 2002 2:30pm
Subject:Re: Timestamp issue
View as plain text  
At 16:49 +0530 9/17/02, Prafulla Girgaonkar wrote:
>Mysql Version::
>Server version          3.23.47-nt
>Protocol version        10
>Connection              . via named pipe
>UNIX socket             MySQL
>Windows NT 4.0 Workstation
>Following is the description of the problem being faced.
>The first timestamp column in a table is set to current date-time 
>value as soon as we update one or more columns in the table.

As documented in the MySQL Reference Manual.

>The guest information is stored in a table named GUEST. The schema 
>for it is as below.
>create table guest (guestID int, arrivalDate timestamp, 
>departureDate timestamp, status char(1));
>Above table is populated using following queries.
>insert into guest values (1, '2002-09-30',  '2002-10-14', 'Y');
>insert into guest values (2, '2002-09-20',  '2002-10-01', 'Y');
>insert into guest values (3, '2002-09-15',  '2002-09-25', 'Y');
>insert into guest values (4, '2002-09-12',  '2002-09-20', 'Y');
>If we use following query to update the status from Y to N, then 
>arrivalDate column is set to CURRENT(system) date-time value.
>update guest set status = 'N';
>Does anybody have any information on this issue?

The manual does.  It also describes the DATETIME type, which may be
preferable for what you're trying to accomplish.

The manual is your friend.  It's a good idea to take advantage of it.

>Thanx in advance.

Timestamp issuePrafulla Girgaonkar17 Sep
  • Re: Timestamp issueMikhail Entaltsev17 Sep
  • Re: Timestamp issuePaul DuBois17 Sep