2010-02-11 13 views

Respuesta

10

Creo que solo puede agregar columnas a su tabla y crear activador para actualizar el valor de la columna con datetime ('ahora');

+2

Eso es lo que trataría de hacer también. Consulte http://www.shokhirev.com/nikolai/abc/sql/triggers.html para ver un ejemplo de "insertar"; tienes que agregar un disparador similar para 'actualizar' también. (no probado) – bart

4

añadir una columna LastModified a su mesa (s), y actualizarlo en la modificación de esa fila.

2
CREATE TRIGGER update_appInfo_updatetime BEFORE update ON appInfo 
begin 
update appinfo set updatedatetime = strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime') where bundle_id = old.bundle_id; 
end 

CREATE TABLE "appInfo" (bundle_id text NOT NULL PRIMARY KEY,appname text,title text DEFAULT appname,display_image text DEFAULT "default.gif",full_size_image text DEFAULT "default.gif",bundle_version text DEFAULT "1.0",company_id text,ipaname text,createdatetime text DEFAULT (strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime')),updatedatetime text DEFAULT (strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime'))) 
Cuestiones relacionadas