sqlite3_column_decltype returns the declared type of a column. (sqlite3_column_type returns the ACTUAL type for the data value -- they are quite independent). sqkite3_column_decltype only works for columns which are table columns and not for expressions -- the declared type for an expression does not exist. Notwithstanding what sqlite3_column_decltype returns each individual value of the column in each individual row may be of any datatype and that information is queried by the sqlite3_column_type API after each row is retrieved before retrieving each value.