| I got that much done, lol. I'm wondering how I access the filesize column from the row being INSERTED or DELETED? Heres what I have so far, but it's throwing an exception because the syntax is wrong somehow:
mycommand.CommandText = "CREATE TRIGGER IF NOT EXISTS 'updateInfoOnDelete' DELETE ON 'cache' BEGIN UPDATE 'info' SET 'totalFiles'=totalFiles-1; UPDATE 'info' SET 'totalFileSize'=totalFileSize-old.filesize; END";
mycommand.ExecuteNonQuery();
mycommand.CommandText = "CREATE TRIGGER IF NOT EXISTS 'updateInfoOnInsert' INSERT ON 'cache' BEGIN UPDATE 'info' SET 'totalFiles'=totalFiles+1; UPDATE 'info' SET 'totalFileSize'=totalFileSize+old.filesize; END";
mycommand.ExecuteNonQuery();
Thanks again for the quick reply. |