Opened 15 years ago
Last modified 15 years ago
#643 assigned enhancement
Sqlite precision no handled on string data type
Reported by: | bscott | Owned by: | traianstanev |
---|---|---|---|
Priority: | major | Milestone: | 3.5.0 |
Component: | SQLite Provider | Version: | 3.5.0 |
Severity: | 3 | Keywords: | |
Cc: | External ID: |
Description
when i create a table with a string column and specifying its precision the table creation works but when i query back it's precision, it returns 1000000000
Change History (6)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Thanks for the datatype documentation, it helps me a lot understanding what's going on.
But wouldn't be a good idea to set the sqlite field type as something like VARCHAR(PRECISION) or TEXT(PRECISION) even if the database won't issue any error inserting,updating. So FDO provider would be able to return the precision ( if specifyied ).
The reason why i'm asking is we use to do a describe on the table to know how we should format the user input before inserting in the database.
comment:3 by , 15 years ago
Type: | defect → enhancement |
---|
I'll check if we can add this without side effects.
comment:4 by , 15 years ago
Status: | new → assigned |
---|
comment:5 by , 15 years ago
Please see my answer to ticket 641:
http://trac.osgeo.org/fdo/ticket/641#comment:7
to see a way you can store the precision in the data type hints table.
comment:6 by , 15 years ago
I've made a test with UseFdoMetadata=TRUE Recreating all my dataset from scratch. Now in the fdo_columns table i have this
fdo_data_type = 4 fdo_data_length = 20 fdo_data_precision = 20 fdo_data_scale = 8
So seems allright
But still got problem filtering on that field. The data itself are ok, i can insert or update any double values it's only the filtering that's get truncated
This is very blocking as we oftenly save Lat and Lon values in databases and filtering with only 5 digit end ups with a big big error
See data types documentation for sqlite:
http://www.sqlite.org/datatypes.html
SQLite will accept the precision for table creation for compatibility pruprposes, but will not limit the lengths of strings that can be inserted in that column.