SQLite typeof() Function

The SQLite typeof() function returns the data type of the parameter, it will return one of these strings: null, integer, real, text, and blob.

Syntax

Here is the syntax of the SQLite typeof() function:

typeof(x)

Parameters

x
Required. It can be any type of data.

Return Value

The SQLite typeof() function returns a string representing the data type of the parameter, the possible values ​​are: null, integer, real, text, and blob.

Examples

This example shows the basic usage of the SQLite typeof() function:

SELECT
    typeof(NULL),
    typeof(12345),
    typeof(1.234),
    typeof('abc'),
    typeof(X'05');
typeof(NULL)  typeof(12345)  typeof(1.234)  typeof('abc')  typeof(X'05')
------------  -------------  -------------  -------------  -------------
null          integer        real           text           blob