On Jun 17, 9:07 pm, "David Crawshaw" <[EMAIL PROTECTED]> wrote:
> 2008/6/18 [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> > Ok, perhaps it needs to wait until the C api matures a bit.  One other
> > observation though, if I may.  DatabaseMetaData.getColumns() returns
> > yet another data type code:
>
> Ah, good catch. That function is parsing the results of pragma
> table_info(), which sadly just returns whatever type name the user
> gave, even if it's nonsense. So it catches int/integer and float, and
> otherwise returns a varchar. This too, is highly questionable
> behaviour. I'm not really sure what would be the best thing to do
> here.

I thought I might be onto something when I noticed
sqlite3_column_decltype
in the C API.  I changed line 145 in NestedDB.java to use
sqlite3_column_decltype instead of
sqlite3_column_type, and rebuilt the driver.  That yields something
other than SQLITE_INTEGER
as the java type code is 12 (Types.VARCHAR) and my debug statement
indicates that
sqlite3_column_decltype is returning 1340304.  For now, I think I'll
try to simply map the
column type name to a java Types constant and use that as the type
code.  If the user wants
to have an imaginary column type, we'll treat it as a VARCHAR.  Thanks
for your help.

Rob

--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to