SQLite Real Number Issue
Posted: Fri Sep 21, 2018 6:22 pm
Hi
Since SQLite does not assign a type to a column I have an issue where a column that I want to always be a real number sometimes is returned as an Integer. For example 50.01 is a real value and returned as real by SQLite but 50.00 is a real value but it is stored in SQLite as 50 and then returned as an integer. So when I want to use the PB GetDatabaseDouble() I do not get a value return instead I have to use GetDatabaseLong(). Currently I am checking the column type every time I want to get the value from the database but I wondered if there is a better scenario to ensure the value is correctly read from the data base.
Thanks,
Simon
Since SQLite does not assign a type to a column I have an issue where a column that I want to always be a real number sometimes is returned as an Integer. For example 50.01 is a real value and returned as real by SQLite but 50.00 is a real value but it is stored in SQLite as 50 and then returned as an integer. So when I want to use the PB GetDatabaseDouble() I do not get a value return instead I have to use GetDatabaseLong(). Currently I am checking the column type every time I want to get the value from the database but I wondered if there is a better scenario to ensure the value is correctly read from the data base.
Thanks,
Simon