Re: [sqlite] Result set column names

2019-12-10 Thread Tim Streater
On 10 Dec 2019, at 21:42, Simon Slavin wrote: > On 10 Dec 2019, at 9:35pm, Doug wrote: > >> For column "xxx" what will the full column name be? "foo.xxx"? > > For column "xxx" in table "foo", yes. > > However, that's only if you've used "PRAGMA full_column_names". And that > PRAGMA is now depre

Re: [sqlite] Result set column names

2019-12-10 Thread Simon Slavin
On 10 Dec 2019, at 9:35pm, Doug wrote: > For column "xxx" what will the full column name be? "foo.xxx"? For column "xxx" in table "foo", yes. However, that's only if you've used "PRAGMA full_column_names". And that PRAGMA is now deprecated so you shouldn't use it.

Re: [sqlite] Result set column names

2019-12-10 Thread Doug
For column "xxx" what will the full column name be? "foo.xxx"? Doug > -Original Message- > From: sqlite-users > On Behalf Of Simon Slavin > Sent: Tuesday, December 10, 2019 10:37 AM > To: SQLite mailing list > Subject: Re: [sqlite] Result set colum

Re: [sqlite] Result set column names

2019-12-10 Thread Simon Slavin
On 10 Dec 2019, at 5:13pm, Doug wrote: > Just to be clear: If I define a column in a table named "xxx", and I "select > xxx from table", the report will show a column named "xxx" always. That's > what the standard says, right? It's not implementation dependent, right? Unless you have specified

Re: [sqlite] Result set column names

2019-12-10 Thread Doug
INTO foo(xxx) VALUES(25) SELECT xxx FROM foo ---|- xxx 25 Doug > -Original Message- > From: sqlite-users > On Behalf Of Adrian Ho > Sent: Tuesday, December 10, 2019 8:04 AM > To: sqlite-users@mailinglists.sqlite.org > Subject: Re: [sqlite] Result set column name

Re: [sqlite] Result set column names

2019-12-10 Thread Adrian Ho
On 9/12/19 3:45 PM, Graham Holden wrote: > Monday, December 09, 2019, 7:25:25 AM, Clemens Ladisch > wrote: > >> The SQL-92 standard actually says: >> >> |Syntax Rules >> | >> |9) Case: >> | >> | b) If the i-th in the does not >> | specify an and the of that >> |

Re: [sqlite] Result set column names

2019-12-08 Thread Graham Holden
Monday, December 09, 2019, 7:25:25 AM, Clemens Ladisch wrote: > The SQL-92 standard actually says: > > |Syntax Rules > | > |9) Case: > | > | b) If the i-th in the does not > | specify an and the of that > | is a single , then the > | of the i-th column

Re: [sqlite] Result set column names

2019-12-08 Thread Clemens Ladisch
Keith Medcalf wrote: > If you do not provide as AS clause to give a result column a name, then > each implementation is free to provide whatever names it feels like (so > sayeth the standard). The SQL-92 standard actually says: |6.4 | | ::= [ ] | |7.9 | | ::= | SELEC

Re: [sqlite] Result set column names

2019-12-08 Thread Keith Medcalf
On Saturday, 7 December, 2019 16:05, Tim Streater wrote: >At various times in various threads on this list it has been stated that >the column name in a result set is not guaranteed unless one uses AS. >IOW, one should say > > select abc as abc from mytable where i=23; > >rather than just: > >

Re: [sqlite] Result set column names

2019-12-07 Thread Simon Slavin
On 7 Dec 2019, at 11:09pm, J. King wrote: > It's stated here, at least: > Also note https://sqlite.org/pragma.html#pragma_short_column_names https://sqlite.org/pragma.html#pragma_full_column_names even though they are now both deprecated. __

Re: [sqlite] Result set column names

2019-12-07 Thread J. King
On December 7, 2019 6:04:36 p.m. EST, Tim Streater wrote: >At various times in various threads on this list it has been stated >that the column name in a result set is not guaranteed unless one uses >AS. IOW, one should say > > select abc as abc from mytable where i=23; > >rather than just: > >

[sqlite] Result set column names

2019-12-07 Thread Tim Streater
At various times in various threads on this list it has been stated that the column name in a result set is not guaranteed unless one uses AS. IOW, one should say select abc as abc from mytable where i=23; rather than just: select abc from mytable where i=23; I'm trying to find where on t

[sqlite] result set column names, when row count = 0

2012-01-15 Thread Larry Brasfield
After a lengthy, fruitless search for an option to make the sqlite3 shell do this, I've modified shell.c to emit a column header row, (after .headers ON), even when the result set is empty. The reason for this is to facilitate creation of tab-separated-value, column-name-headed, text tables fo

Re: [sqlite] Result set column names

2011-01-08 Thread Peter
Jay A. Kreibich wrote, On 08/01/11 14:07: > On Sat, Jan 08, 2011 at 09:12:36AM +, Simon Slavin scratched on the wall: >> >> On 8 Jan 2011, at 9:09am, Peter wrote: >> >>> So the 'column name' may be some internal representation/magic number >>> and bear no direct relationship to the name in the

Re: [sqlite] Result set column names

2011-01-08 Thread Jay A. Kreibich
On Sat, Jan 08, 2011 at 09:12:36AM +, Simon Slavin scratched on the wall: > > On 8 Jan 2011, at 9:09am, Peter wrote: > > > So the 'column name' may be some internal representation/magic number > > and bear no direct relationship to the name in the projector as supplied > > in the SELECT? >

Re: [sqlite] Result set column names

2011-01-08 Thread Peter
On 08/01/11 09:12, Simon Slavin wrote: > > On 8 Jan 2011, at 9:09am, Peter wrote: > >> So the 'column name' may be some internal representation/magic number >> and bear no direct relationship to the name in the projector as supplied >> in the SELECT? > > For columns which are exact copies of column

Re: [sqlite] Result set column names

2011-01-08 Thread Simon Slavin
On 8 Jan 2011, at 9:09am, Peter wrote: > So the 'column name' may be some internal representation/magic number > and bear no direct relationship to the name in the projector as supplied > in the SELECT? For columns which are exact copies of columns in a table, the name is always a copy of the

Re: [sqlite] Result set column names

2011-01-08 Thread Peter
On 07/01/11 18:41, Igor Tandetnik wrote: > On 1/7/2011 1:31 PM, Peter wrote: >> In the C interface documentation we are told: >> >> "The name of a result column is the value of the "AS" clause for that >> column, if there is an AS clause. If there is no AS clause then the name >> of the column is u

Re: [sqlite] Result set column names

2011-01-07 Thread Artur Reilin
Isn't it also depending if there are columns which have the same name or not? > On 1/7/2011 1:31 PM, Peter wrote: >> In the C interface documentation we are told: >> >> "The name of a result column is the value of the "AS" clause for that >> column, if there is an AS clause. If there is no AS clau

Re: [sqlite] Result set column names

2011-01-07 Thread Igor Tandetnik
On 1/7/2011 1:31 PM, Peter wrote: > In the C interface documentation we are told: > > "The name of a result column is the value of the "AS" clause for that > column, if there is an AS clause. If there is no AS clause then the name > of the column is unspecified and may change from one release of SQ

Re: [sqlite] Result set column names

2011-01-07 Thread Peter
In the C interface documentation we are told: "The name of a result column is the value of the "AS" clause for that column, if there is an AS clause. If there is no AS clause then the name of the column is unspecified and may change from one release of SQLite to the next." What exactly is mean