1. bigdogjonx's Avatar
    So awhile back I posted a thread on this and with the help of Piranha I was able to increase my call history count past 100. It was basically a simple trigger to re-insert the record back into the call table when it gets deleted by the system because it seems the 100 count is hard coded and no way to get around that.

    So Ive been running it for almost 6-8months and noticed the other day that my recent list is somewhat jacked up, looking at the date it goes from todays to back a week then all the sudden jumps 2months back. After investigating more this is whats happening. I have my call_history set to hold 1000 (I do a select count on the condition of <1000 before enabling the trigger) and what seems to be happening is that anything above 100 is still being deleted and basically 900 are being deleted and reinserted. So whats happening is that they all get new ROWIDs as well. So every call I make the new ROWID is 900 higher than the previous one.

    I tried a bunch of things, removed the condition to make it so its unlimited, but then it would just delete more from the list, so then it would delete 901, then 902 for the next call, 903 and so on, so basically it seems clear cut that its simply right off the bat deleting anything past 100 and the trigger is basically reinserted everything it deletes. So this is probably not going to work in the long run.

    So not sure if anyone has seen this or looked at their recent calls list in detail if they have used this, but wondering if someone has a better solution to increasing the call_history table count.


    Here is the delete trigger Piranha helped me out with

    CREATE TRIGGER [deleteKeep] 
    BEFORE DELETE ON [call] 
    FOR EACH ROW WHEN (select count(*) from call)<1000 
    insert into call
    select null,address,date,duration,flags,id from call
    where call.ROWID=OLD.ROWID ;
    2008-06-02 07:13 AM