on update current_timestamp with SQLite

Yes, you’d need to use a trigger. (Just checking: is your posted trigger working correctly? At first glance, it looks fine to me.) MySQL’s ON UPDATE CURRENT_TIMESTAMP is a pretty unique, single-purpose shortcut. It is what it is; this construct cannot be used similarly for any other values or for any column types other than … Read more

How do I trigger a macro to run after a new mail is received in Outlook?

This code will add an event listener to the default local Inbox, then take some action on incoming emails. You need to add that action in the code below. Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim olApp As Outlook.Application Dim objNS As Outlook.NameSpace Set olApp = Outlook.Application Set objNS = olApp.GetNamespace(“MAPI”) ‘ default … Read more

How can I use enum types in XAML?

I had a similar question here, and my end result was to create a generic IValueConverter that passed the enum value I wanted to match in as the ConverterParameter, and it returns true or false depending on if the bound value matches the (int) value of the Enum. The end result looks like this: XAML … Read more

How can I edit values of an INSERT in a trigger on SQL Server?

Use an after insert trigger. Join from the inserted pseudo table to Tb on the primary key. Then update the values of desc. Something like: (But may not compile) CREATE TRIGGER TbFixTb_Trg ON Tb AFTER INSERT AS BEGIN UPDATE Tb SET DESC = SomeTransformationOf(i.DESC) FROM Tb INNER JOIN inserted i on i.Id = Tb.Id END … Read more

Postgresql trigger function with parameters

You do not need to pass the NEW and OLD as parameters to the trigger function. They are automagically available there: http://www.postgresql.org/docs/9.1/interactive/trigger-definition.html : The trigger function must be declared as a function taking no arguments and returning type trigger. (The trigger function receives its input through a specially-passed TriggerData structure, not in the form of … Read more