I think from recent discussions, it became clear that supporting these extra pragmas was
becoming a big headache. I don't know that tsupport has been deliberately dropped, but
it may have fallen by the wayside. The reasons for this are that the behavior now matches
all the other RDBMSes in widespread use (mysql, postgresql, oracle) and previous behavior
can be gotten by using aliases. Personally, I like that. I don't want to use the pragmas, I don't
want Dr Hipp spending time maintaining them instead of more useful work. For what you're
doing, it appears that you don't want to change the sql that you already have, probably because
there's a lot of it and very spread out. So you may have differnet priorities. If however, you do
decide to change it, keep in mind that you can do the following to fix your problem:


for query 1:
select
   a.col1 as "a.col1", a.col2 as "a.col2",
   b.col1 as "b.col1", b.col2 as "b.col2"
from
   a_table a inner join b_table b on a.col1 = b.col1

Anyway, just some thoughts

John

Drew, Stephen wrote:

Hello,

Has anyone else had any problems getting the column names pragmas
working in SQLite 3.x ?

I can't seem to get them to work, and can't find anything relating to
the latest version on the website.

Thanks,
Steve


-----Original Message-----
From: Drew, Stephen Sent: 06 April 2005 11:57
To: sqlite-users@sqlite.org
Subject: [sqlite] Column Names (revisited)


Hello,

I've been looking into upgrading to 3.2.1 from 2.8.15 and am still
running into problems with returned column names.

I've written a piece of code to test four scenarios with 2.8.15 and
3.2.1 and these are the results:

Two tables:
CREATE TABLE A_TABLE (col1 INTEGER, col2 INTEGER) CREATE TABLE B_TABLE
(col1 INTEGER, col2 INTEGER)

Two queries:
1. SELECT A.*, B.* FROM A_TABLE, B_TABLE WHERE A.col1 = B.col1 2. SELECT
* FROM A_TABLE

The column names are returned as follows (with the relevant column names
pragmas).

------------------------------------------------------------------------
-----------------------
TEST PRAGMAS                            2.8.15
3.2.1
------------------------------------------------------------------------
----------------------- 
1 (short=0, full=0)                     A.col1, B.col1, ...
col1, col1, ...                         
2 (short=0, full=0)                     col1, col2, ...
col1, col2, ...

1 (short=1, full=0)                     col1, col1, ...
col1, col1, ...                         
2 (short=1, full=0)                     col1, col2, ...
col1, col2, ...

1 (short=0, full=1)                     A_TABLE.col1, B_TABLE.col1, ...
col1, col1, ...                         
2 (short=0, full=1)                     A_TABLE.col1, A_TABLE.col2, ...
col1, col2, ...
------------------------------------------------------------------------
-----------------------

In other words, the pragmas seem to have NO effect when the same piece
of code compiled against 2.8.15 is compiled against 3.2.1.  I ALWAYS get
returned just the column names.

All I need to do is guarantee that the column names will turn out like
the first two rows of the table !!

Can anyone offer any help? I'm using standard sqlite_step
functionality, which is working as expected in 2.8.15.


Regards,
Steve








Reply via email to