Search notes:

SQLite function: typeof

typeof(val) returns the data type of a value. The type of typeof itselfs is text. The returned strings are one of integer, real, text, null or blob.
create table tq84_typeof (col);

insert into tq84_typeof values ( 1   );
insert into tq84_typeof values ( 1.0 );
insert into tq84_typeof values ('1.0');
insert into tq84_typeof values ( null);
insert into tq84_typeof values ( zeroblob(20));

.mode column
.width 10 30
.nullvalue '<null>'

select col, typeof(col) from tq84_typeof;
--
-- 1           integer                       
-- 1.0         real                          
-- 1.0         text                          
-- <null>      null                          
--             blob   

drop table tq84_typeof;
Github repository about-sqlite, path: /functions/typeof.sql

See also

functions

Index