On Wed, Feb 17, 2016 at 2:36 PM, Glyn Jones <glynj at bsquare.com> wrote:

> The field is TEXT:
>
> sqlite> .schema operators
> CREATE TABLE operators (
>                 uid INTEGER PRIMARY KEY,
>                 id TEXT UNIQUE NOT NULL CHECK(length(id) BETWEEN 1 AND 20),
>                 name TEXT CHECK(length(trim(name)) > 0)
>         );
>

FWIW, the _declared_ type means very little in sqlite - it can store _any_
type in that field, regardless of the declaration. You might want to add a
type check to your CHECK() constraint. i don't currently remember how to do
that, but someone on this list does and will likely answer very soon. (Yes,
i'm looking at you, Simon!)

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

Reply via email to