Re: [sqlite] Table name syntax

2016-11-22 Thread James K. Lowden
On Mon, 21 Nov 2016 20:46:45 + David Raymond wrote: > insert into main.foo > select db1.foo.* > from db1.foo left outer join db2.bar > on db1.foo.pk = db2.bar.pk > where db2.bar.pk is null; Just by the way, your query could be cast as insert into main.foo select

Re: [sqlite] Table name syntax

2016-11-22 Thread David Raymond
users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Monday, November 21, 2016 4:33 PM To: SQLite mailing list Subject: Re: [sqlite] Table name syntax On 11/21/16, Don V Nielsen <donvniel...@gmail.com> wrote: >> And since the "*" forms are considered bad style > > I have done

Re: [sqlite] Table name syntax

2016-11-21 Thread Richard Hipp
On 11/21/16, Don V Nielsen wrote: >> And since the "*" forms are considered bad style > > I have done this, not knowing it is bad style. Can you provide some reasons > why it is bad? Years later when somebody does "ALTER TABLE ... ADD COLUMN" your application will begin

Re: [sqlite] Table name syntax

2016-11-21 Thread Don V Nielsen
> And since the "*" forms are considered bad style I have done this, not knowing it is bad style. Can you provide some reasons why it is bad? I can assume, "Applications are supposed to be controlled environments, and using tbl.* introduces uncertainty outside the applications control." But are

Re: [sqlite] Table name syntax

2016-11-21 Thread Richard Hipp
On 11/21/16, David Raymond wrote: > > Following the nice SQL diagrams it looks like in a select you can only have > * or table-name.*, whereas in other places you can have > schema-name.table-name. Granted, the second version can be made prettier and > more readable, but

[sqlite] Table name syntax

2016-11-21 Thread David Raymond
Basic syntax question on qualified table names in a select. I've got 2 attached databases, say db1 and db2, and I try to run... insert into main.foo select db1.foo.* from db1.foo left outer join db2.bar on db1.foo.pk = db2.bar.pk where db2.bar.pk is null; and I get "Error: near "*": syntax