SQLite Forum

CTEs in triggers
Login
Of course, the statement you have specified in the trigger (the INSERT statement), once the syntactic sugar is removed, is simply:

```
INSERT INTO dst SELECT new.content;
```

In all usage cases of the WITH statement, other than recursive usage, is merely "syntactic sugar" for alternate spellings of the same thing that does not use the WITH keyword.

In other words, there is no particular reason why a WITH statement will not WORK in a trigger, though if you use one and it happens to work today but not tomorrow then that is YOUR problem, not the SQLite3 authors problem.  Nor is it their problem it you use one that you think should work but does not.

"Not supported" does not mean "does not work".  In the more common case the phrase is a marketing term which means "make money from".  That is, when Microsoft says "Windows XP is no longer supported", that has nothing whatsoever to do with "working" but rather with the speaker "making money from" whatever they are disavowing.  That is, Microsoft is saying that "Microsoft no longer makes money from Windows XP" and that you should give them money to transition to a product which they do "make money from" on an ongoing basis.

In the case of SQLite3, this usage makes no sense.  Rather it means that if it fails to work as YOU intend, then that is YOUR problem, not MINE.

It is merely an advice that if you desire "guaranteed working" you should explore alternate spellings which achieve the same objective result but do not use the WITH syntax because although it may appear to work today, tomorrow that might not be the case and that no "special effort" will be made to ensure that it does work.