SQLite typeof

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

SQLite typeof() function

Description

The typeof() function returns a string that indicates the datatype of the expression. The only return values are : "null", "integer", "real", "text", or "blob".

Syntax

typeof(X)

SQLite Version : 3.8.5

Arguments

Example : SQLite typeof() function

The following SQLite statement returns the datatype from the given expressions.

  1. SELECT typeof('w3resource.com');  

Here is the result.

typeof('w3resource.com')
------------------------
text
  1. SELECT typeof(5347);  

Here is the result.

typeof(5347)
------------
integer
  1. SELECT typeof(5347.2147);  

Here is the result.

typeof(5347.2147)
-----------------
real
  1. SELECT typeof(NULL);  

Here is the result.

typeof(NULL)
------------
null
  1. SELECT typeof('true and false');  

Here is the result.

typeof('true and false')
------------------------
text