Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what are Datatypes in SQLite supporting android

Can anyone please tell me the LIST OF DATATYPES in SQLITE supporting ANDROID.

I want to confirm about TIME and DATE datatypes.

like image 929
Siya Avatar asked Sep 30 '10 12:09

Siya


People also ask

What data type does SQLite support Android?

Date and Time Datatype SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values: TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS. SSS").

What are the datatypes supported by SQLite?

SQLite only has four primitive data types: INTEGER, REAL, TEXT, and BLOB. APIs that return database values as an object will only ever return one of these four types.

What is REAL datatype in SQLite?

Real values are real numbers with decimal values that use 8-byte floats. TEXT. TEXT is used to store character data. The maximum length of TEXT is unlimited. SQLite supports various character encodings.


2 Answers

Here is a list of SQLite's data types

TIME and DATE are supported indirectly.

like image 98
mreichelt Avatar answered Oct 02 '22 15:10

mreichelt


As said at Datatypes In SQLite Version 3:

Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes:

  • NULL. The value is a NULL value.

  • INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.

  • REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.

  • TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).

  • BLOB. The value is a blob of data, stored exactly as it was input.

And for TIME and DATE storage the following is stated:

Date and Time Datatype

SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:

  • TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS").
  • REAL as Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar.
  • INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.
like image 21
Dediqated Avatar answered Oct 02 '22 16:10

Dediqated