P Kishor wrote: > On Mon, Sep 21, 2009 at 5:10 PM, Guillermo Varona Silupú > <gvaro...@hotmail.com> wrote: > >> Hi >> In these SQL commands: >> >> CREATE TABLE "test" ("code" char(2)); >> INSERT INTO test (code) VALUES("123") >> >> Why are allowed to keep a text of 3 characters in a field that has been >> set to 2? >> Is a bug? >> > > > nope. It is by design. Read up on datatypes in sqlite. If you are > concerned about what goes where, you have to put the checks in your > application. >
One thing that I haven't been able to find explicitly is there is no advantage to using CHAR(2). In my db I have blobs and strings that are of an exact length, but I don't bother declaring them as anything but BLOB and TEXT, since I don't expect it'll optimize anything. So can someone confirm for me that CHAR(2) does nothing for efficiency and everything for compatibility? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users