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