Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-26 Thread James K. Lowden
On Sat, 23 Jul 2016 01:06:23 + "Smith, Randall" wrote: > Using "REFERENCES main.Symbols" appears to be a syntax error. I think you got caught by a special case. Any kind of DRI would be hard to enforce across database boundaries. In general, if we have two

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread Simon Slavin
> On 23 Jul 2016, at 3:33pm, Dan Kennedy wrote: > >> On 2016/07/23 3:30 PM, Simon Slavin wrote: >> >>> The other way around should fine, though: use a permanent table to ensure >>> that only legitimate values appear in a temporary table. > > The trouble is that some

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread Quan Yong Zhai
t1 select new.id where new.x > 1; end; 发件人: Smith, Randall<mailto:rsm...@qti.qualcomm.com> 发送时间: ‎2016/‎7/‎23 9:06 收件人: sqlite-users@mailinglists.sqlite.org<mailto:sqlite-users@mailinglists.sqlite.org> 主题: [sqlite] REFERENCES from TEMPORARY tab

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread Dan Kennedy
On 07/23/2016 08:49 PM, R Smith wrote: On 2016/07/23 3:30 PM, Simon Slavin wrote: On 23 Jul 2016, at 2:24pm, R Smith wrote: No, it's not possible to forge permanent references to/from temporary tables - it defies the objective of being "temporary". The other way around

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread R Smith
On 2016/07/23 3:30 PM, Simon Slavin wrote: On 23 Jul 2016, at 2:24pm, R Smith wrote: No, it's not possible to forge permanent references to/from temporary tables - it defies the objective of being "temporary". The other way around should fine, though: use a permanent

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread Simon Slavin
On 23 Jul 2016, at 2:24pm, R Smith wrote: > No, it's not possible to forge permanent references to/from temporary tables > - it defies the objective of being "temporary". The other way around should fine, though: use a permanent table to ensure that only legitimate values

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread R Smith
On 2016/07/23 3:06 AM, Smith, Randall wrote: Hi. I'm creating a specialized index table to a persistent table that I need to speed up a one-time operation. This seems like a great application for a TEMPORARY table in SQLite, so the index will always be reliably cleaned up. However, I can't

Re: [sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-23 Thread Clemens Ladisch
Smith, Randall wrote: > Is it impossible to have references from temp tables to main tables? Yes. > If so, aren't TEMPORARY tables largely useless? Only if you want to use foreign key constraints. > Is there another idiom in SQLite for managing tables that are intended > to have a short life

[sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-22 Thread Smith, Randall
Hi. I'm creating a specialized index table to a persistent table that I need to speed up a one-time operation. This seems like a great application for a TEMPORARY table in SQLite, so the index will always be reliably cleaned up. However, I can't find a way to have REFERENCES to the main table