updating records without changing timestamp fields
hi there, the subject tells almost everything, I try to update records in a table and everytime I do this, the timestamp field ist set to now(). how can I keep the previously stored value for this field (there are values created before)? thanks for your help, henning -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating records without changing timestamp fields
That is the purpose of timestamp. Henning Heil wrote: hi there, the subject tells almost everything, I try to update records in a table and everytime I do this, the timestamp field ist set to now(). how can I keep the previously stored value for this field (there are values created before)? thanks for your help, henning -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating records without changing timestamp fields
On 27 Oct 2003 at 21:21, Henning Heil wrote: how can I keep the previously stored value for this field (there are values created before)? Explicitly SET timestamp_column = timestamp_column. See here: http://www.mysql.com/doc/en/DATETIME.html But if you never want the TIMESTAMP column to update automatically, you shouldn't be using TIMESTAMP in the first place. You probably want DATETIME instead. -- Keith C. Ivey [EMAIL PROTECTED] Tobacco Documents Online http://tobaccodocuments.org -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating records without changing timestamp fields
use timestamp_col = timestamp_col in your query, to override the NOW() affect. I just passed by this comment this morning http://www.mysql.com/doc/en/DATETIME.html -- user comments at bottom of page hth Jeff Henning Heil [EMAIL PROTECTED]To: MySQL List [EMAIL PROTECTED] com cc: Subject: updating records without changing timestamp fields 10/27/2003 03:21 PM hi there, the subject tells almost everything, I try to update records in a table and everytime I do this, the timestamp field ist set to now(). how can I keep the previously stored value for this field (there are values created before)? thanks for your help, henning -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating records without changing timestamp fields
* Henning Heil the subject tells almost everything, I try to update records in a table and everytime I do this, the timestamp field ist set to now(). how can I keep the previously stored value for this field (there are values created before)? You can assign the current value to it: UPDATE table1 SET some_col = 5, other_col = test, timestamp_col = timestamp_col WHERE key_col = 123; -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating records without changing timestamp fields
[EMAIL PROTECTED] wrote on 27.10.2003 21:31 use timestamp_col = timestamp_col in your query, to override the NOW() affect. I just passed by this comment this morning http://www.mysql.com/doc/en/DATETIME.html -- user comments at bottom of page hth Jeff all, thanks for your help! sorry i missed the thread this morning, it's hard to have an eye on all the lists :-( good to know what timestamp was originally meant to do, very useful functionality of course (if one knows how it works!). thanks again, henning -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: updating records without changing timestamp fields
Add Two Time stamps. Only one will get update. Mat -Original Message- From: Keith C. Ivey [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 1:31 PM To: MySQL List Cc: Henning Heil Subject: Re: updating records without changing timestamp fields On 27 Oct 2003 at 21:21, Henning Heil wrote: how can I keep the previously stored value for this field (there are values created before)? Explicitly SET timestamp_column = timestamp_column. See here: http://www.mysql.com/doc/en/DATETIME.html But if you never want the TIMESTAMP column to update automatically, you shouldn't be using TIMESTAMP in the first place. You probably want DATETIME instead. -- Keith C. Ivey [EMAIL PROTECTED] Tobacco Documents Online http://tobaccodocuments.org -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating records without changing timestamp fields
On 27-Oct-2003 Henning Heil wrote: hi there, the subject tells almost everything, I try to update records in a table and everytime I do this, the timestamp field ist set to now(). how can I keep the previously stored value for this field (there are values created before)? UPDATE [table] SET [timestamp]=[timestamp], ... Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]