Christian Werner <[EMAIL PROTECTED]> writes:

> Jarl Friis wrote:
>
>> I have fixed a bug in the SQLite ODBC driver. The problem is that the
>> ODBC driver does not use the info from "PRAGMA table_info(...)" when
>> there are no columns declared as "integer".
>
> What exactly is wrong with the current implementation ? The purpose of
> the code following the "if (!doautoinc)" expression is the detection
> of columns with autoincrement behaviour. If I understand the SQLite
> documentation correct, the only way to create an autoincrement column
> is "columnname INTEGER PRIMARY KEY AUTOINCREMENT"

Correct, the thing is that you return from the function if no such
columns are found. meaning that the code that ensures that correct
SQL_ types (using "pragma table_info(...)" ) is never reached. meaning
that a table like CREATE TABLE t1 (c1 TEXT, c2 DOUBLE) will, from the
ODBC client interface, have two columns with types SQL_VARCHAR. but a
table like CREATE TABLE t2 (c1 TEXT, c2 DOUBLE, c3 INTEGER) will have
correct column types: SQL_VARCHAR, SQL_DOUBLE, SQL_INTEGER.

> (from http://www.sqlite.org/autoinc.html).  Please let me know a)
> the SQL you used to create an autoinc column which b) is not
> detected by the current implementation, and c) which SELECTs failed
> with the current implementation.

The point is that it fails (wrt. type mapping) when there are NO
autoinc columns.

>
>> Further I wonder what's behind the decision to use
>> PRAGMA short_column_names = off
>> PRAGMA full_column_names = on
>> 
>> When using short_column_names instead (which is default),
>> behaviour seems closer to standard Database SQL engines.
>> 
>> Could you ellaborate on this decision?
>
> To be able to implement SQLColumnAttribute(...SQL_DESC_TABLE_NAME...)
> efficiently.

I see, I believe you mean SQLColAttributes(...).

Wouldn't it be a good idea to limit the sqlite state change to this
purpose only?

Have you ever considered making a real project out of the SQLite ODBC
driver? e.g. using http://www.sourceforge.net/

Jarl

-- 
Jarl Friis
Softace ApS
Omøgade 8, 2.sal
2100 København Ø.
Denmark
Phone:  +45 26 13 20 90
E-mail: [EMAIL PROTECTED]
LinkedIn: https://www.linkedin.com/in/jarlfriis

Reply via email to