Re: [sqlite] creating trigger to handle multiple types of insert

2014-11-26 Thread Igor Tandetnik
On 11/26/2014 8:58 PM, Sam Carleton wrote: The question is how to make the trigger work for both cases. Experimentally, when EventNodeId is omitted from INSERT statement, new.EventNodeId == -1 in the trigger. So I think something like this should work: INSERT INTO EventNode ( EventNodeId, .

[sqlite] creating trigger to handle multiple types of insert

2014-11-26 Thread Sam Carleton
There are two different types of insert that need to happen into a table, one is where the rowid (EventNodeId) is part of the actual insert, the other it is excluded so that AUTOINCREMENT will fill it in. There is an insert triggers to set the audit fields on the table during the insert. The questi