On Wed, Mar 9, 2011 at 11:28 PM, Igor Tandetnik <itandet...@mvps.org> wrote:
> On 3/9/2011 5:19 PM, Armin Kunaschik wrote:
>> I'm trying this for quite some time... and I'm totally stuck.
>>
>> I have the following table:
>>
>> CREATE TABLE example(
>>   date integer primary key not null,
>>   text text,
>>   ctime TIMESTAMP,
>>   mtime TIMESTAMP);
>>
>> ctime=creation time (should be set only once)
>> mtime=modification time (should be set every time the row is updated)
>>
>> Important: I also want to be able to "insert or replace" rows and keep ctime.
>
> INSERT OR REPLACE is indistinguishable from a DELETE followed by INSERT.
> I don't see how you can preserve ctime through that.
Is it really DELETE and INSERT internally?
This would explain, why ctime is "invisible" inside the trigger...
it's simply not there
when replace is used.

Maybe I should think about using a temporary table for that purpose...
any ideas?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to