Hello,
 
It's that time of the month again - column naming convention discussion.
 
The documentation states quite clearly:
 
Case 4: short_column_names=OFF and full_column_names=OFF 

For this case (which was the default prior to version 3.1.0) the result
is the same as for case 2 for simple queries and is the same as case 5
for joins. In other words, for a query with only a single table in the
FROM clause, the name of the result set column matches the text of the
expression that defined the column as in case 2. For a join, the column
name is of the form "TABLE.COLUMN" where TABLE and COLUMN are the names
of the table and column from which the data comes, as defined in the
original CREATE TABLE statement. 

Now this is great, but (and this isn't the first time I've mentioned
it)....

CREATE TABLE TEST1  (a INTEGER, b TEXT, PRIMARY KEY (a))

CREATE TABLE TEST2  (a INTEGER, b TEXT, PRIMARY KEY (a))

SELECT T1.a, T1.b, T2.a, T2.b FROM TEST1 T1, TEST2 T2 WHERE T1.a = T2.a

---------------> this is fine and returns the column names as written

SELECT T1.*, T2.* FROM TEST1 T1, TEST2 T2 WHERE T1.a = T2.a

---------------> this STILL returns without the table-alias prefix.

In my mind these statements both fall into the category mentioned above.

 

Can I ask what the logic is here?  (this page doesn't seem to cover it:
http://www.sqlite.org/cvstrac/wiki?p=ColumnNames)  

Following the upgrade to 3.2.5 (on the basis this had been fixed), I do
not want to tell my users to expand their  T1.*  to include all the
column names, as this is a pain when the tables have hundreds of
columns.....

Any thoughts appreciated.

Regards,

Steve

Reply via email to