Re: [sqlite] Kind of function out of common table expression

2017-12-20 Thread Clemens Ladisch
Yannick Duchêne wrote: >I wonder is there is a way with SQLite3, to reuse a often used and >moderately long common table expression without the need to copy/paste >it in every query text it is used in. If you do not need dynamic parameters, use a view. Otherwise, you have to write out the

Re: [sqlite] Kind of function out of common table expression

2017-12-20 Thread Yannick Duchêne
Indeed, a preprocessor may be an option, since all the queries are stored in text files (which are loaded by an application or directly used with copy/paste). If that's better or not than a function added per‑connection, it’s a matter of taste. I will have to decide. -- Sent from:

Re: [sqlite] Kind of function out of common table expression

2017-12-20 Thread Nelson, Erik - 2
Yannick Duchêne Sent: Wednesday, December 20, 2017 5:23 PM >I wonder is there is a way with SQLite3, to reuse a often used and >moderately long common table expression without the need to copy/paste it in >every query text it is used in. I use a C preprocessor for this and pass the queries

[sqlite] Kind of function out of common table expression

2017-12-20 Thread Yannick Duchêne
Hi there, I wonder is there is a way with SQLite3, to reuse a often used and moderately long common table expression without the need to copy/paste it in every query text it is used in. I know there is a way to add a function to SQLite connexions using DB APIs, like that of Python. Still, as