Create Table:
db.execSQL("CREATE TABLE " + PERSONS_TABLE + " ("
+ PersonsColumns.ID
+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
...
+ PersonsColumns.HEIGHT + " FLOAT, "
+ PersonsColumns.CITY + " STRING);");
Write Data:
ContentValues values = new ContentValues();
alues.put(PersonsColumns.HEIGHT, 1.7976931348623157E308);
db.insertOrIgnore(values);
You can see the value 1.7976931348623157E308 is out of the FLOAT value range(4 bytes) in sqlite. why it can correctly store this value ?
SQLite is "typeless".You can store any kind of data you want in any column of any table, regardless of the declared datatype of that column
SQLite also allows the datatype to be omitted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With