Hughman <hugh...@gmail.com> wrote:
>> There is no Time type in SQLite.
>
> Oops... I use Sqlite Administrator to create a table , and the
> datatypes are
> almost as many as MySQL , such as Date, Time, TimeStamp, varchar.
> Since sqlite only has 5 kinds of datatype, why doesn't it throw a
> error
> message when I create a table with a wrong datatype?

In SQLite, you can write

create table t(col LOREM IPSUM);

and it will happily accept LOREM IPSUM as the type name. The article I 
referred you to explains how column affinity is determined from type 
name. TIME is not in any way special.

>> I bet you don't actually use quotes as you show above.
> In fact, I have used in the sql code.

Ah, right. The type name of TIME would result in NUMERIC column 
affinity. This means that a string that looks like a number is converted 
to and stored as a number.

Use TEXT, CHAR or VARCHAR for a type name to get TEXT affinity, or omit 
the type name entirely to get no affinity.

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to