4 messages in com.mysql.lists.win32Re: Update timestamp with a select| From | Sent On | Attachments |
|---|---|---|
| Urcid Pliego, Paulo | 01 Apr 2006 12:24 | |
| Jan Theodore Galkowski | 01 Apr 2006 14:56 | |
| SGr...@unimin.com | 02 Apr 2006 21:03 | |
| jbon...@sola.com.au | 04 Apr 2006 16:35 |
| Subject: | Re: Update timestamp with a select![]() |
|---|---|
| From: | SGr...@unimin.com (SGr...@unimin.com) |
| Date: | 04/02/2006 09:03:32 PM |
| List: | com.mysql.lists.win32 |
"Urcid Pliego, Paulo" <paul...@vw.com.mx> wrote on 04/01/2006 03:24:57 PM:
Hi, does anyone know if it's possible for a timestamp column to automatically update itself when a select is made? We have a user/password/roles database that is accessed by Tomcat's j_security module whenever a user logs into one of our webapps, and I want to know which users haven't logged in recently so that I can erase their accounts. I would appreciate all of your feedback on this one.
Thanks!
Paulo Urcid Pliego E-Labor Producción DM e IM Preserie y Construcción de Equipos
Volkswagen de México S.A. de C.V. Teléfono +52 (222) 2 30 9961 Fax +52 (222) 2 30 6082 mailto:urc...@vw.com.mx http://www.vw.com.mx
Every SQL standard that I have read does NOT allow for read operations (such as SELECT statements) to affect the data being read. It would create a very chaotic situation if it were possible to read the same row of data twice in a row and get different responses, wouldn't it?
In order to change a record, you need to try to UPDATE it. The act of logging in is sufficient justification for me to run an UPDATE statement to change the last login datetime value to something else. Were you just trying to get two actions with one statement?
Shawn Green Database Administrator Unimin Corporation - Spruce Pine




