Beware of the application you use to check what is in your Data Base file.
Why ?
Because some of them may check the data you ask and return them the way the programmer thing these data have to be returned.
Example to be clear on what I THINK:
Imagine a Column Name who holds the word Date. If you put something that is not a SQLIte Date, you may be in trouble because the Reader Application may try to understand a SQL Date from the data stored in that field.
You may have declared that Date Field as DATE: the Reader Application may want to get a .DateValue and may return from your field.
No point. The only types that it is worth using with SQLite are those mentioned in the SQLite docs (see Eli Ott’s answer above). You should read it carefully.
If you use VARCHAR it will be treated as TEXT. And any length you supply, as in VARCHAR(200), is completely ignored.
[quote=342233:@Tim Streater]No point. The only types that it is worth using with SQLite are those mentioned in the SQLite docs (see Eli Ott’s answer above). You should read it carefully.
If you use VARCHAR it will be treated as TEXT. And any length you supply, as in VARCHAR(200), is completely ignored.[/quote]
i have no idea the 200 in VARCHAR is ignore… will start using TEXT then
Please read about SQLite Affinity…
any datatype that contains “CHAR” is treated like “text”
however, ANY affinity “can” contain “ANY” data…
not to say that a given application may not over-ride the loose-ness of SQLite datatyping
but if you said
CREATE table xyz(abc Integer);
Insert into xyz values("fred");
select * from xyz;
you get “fred” even though the “datatype” was Integer
[quote=342342:@Dave S]Please read about SQLite Affinity…
any datatype that contains “CHAR” is treated like “text”
however, ANY affinity “can” contain “ANY” data…
not to say that a given application may not over-ride the loose-ness of SQLite datatyping
but if you said
CREATE table xyz(abc Integer);
Insert into xyz values("fred");
select * from xyz;
you get “fred” even though the “datatype” was Integer[/quote]
i know about that… i guess i use the varchar with a number to let me know that the field is a small field with max number is 10 or 255 or 4000.