Re: [Modeling-users] Sqlite numeric types returnes as strings
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-09-18 17:33:22
|
A very, very quick answer: try to modify _sqlite.c in pysqlite, around l.1169 you'll find: else if (strstr(type_name, "FLOAT")) { type_code = tc_FLOAT; } Replace it with: else if (strstr(type_name, "FLOAT") || strstr(type_name, "NUMERIC")) { type_code = tc_FLOAT; } and you'll get the expected behaviour for NUMERIC types. Other types can be added the same way. I'll request for the necessary additions probably late this evening. Regards, -- Sébastien. > pysqlite 4.3.0 > > Ok, I've checked it out > * good types: ['integer', 'int', 'int4', 'smallint', 'int2', 'bigint', > 'int8', 'float4', 'float8'] > > * bad types ['real', 'double precision', 'double', 'numeric', > 'numeric(15)', 'numeric(15,5)', 'decimal', 'decimal(15)', > 'decimal(15,5)'] > > I got the types from postgres (I know, that not all are ANSI SQL 92, but > a lot of them are.) > I've sent a bug report to pysqlite @ sf. > > If anyone ones the test procedure used, let me know. > > Best regards, > Erny |