Igor Tandetnik wrote:
arbalest06 <[EMAIL PROTECTED]> wrote:
i want to create a database with a table that has a column which is a
TEXT..i want to specify the maximum length of the text..but i cant do
TEXT(20)( ie., 20 characters max )..how can i do this?..

create table t (a text check(length(a) <= 20));

also i would like to specify that this column should be a required
field..so if the column was not given a value during insert, it would
return an sqlite error code..how can i implement this?..

create table t (a text check(length(a) <= 20) not null);


You might also want to add a minimum length check to prevent users from entering an empty string (i.e. length of zero with no text, but still not a null value).

create table t (a text not null check(length(a) >= 0 and length(a) <= 20));

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to