SQLite Forum

how to refuse write empty value
Login
See the documentation:  <https://sqlite.org/syntax/column-constraint.html>

(You start at <https://sqlite.org/lang_createtable.html> then fondle the column-def "show" button so you will be showed what a column definition looks like, and then from that you fondle the column-constraint "show" button to show you what a column constraint looks like.

So the syntax you want to create a column constraint according to that documentation would look something like the following:

```
create table tab
(
  col1,
  col2 check (col2 !=''),
  col3
);

insert into tab (col1, col2, col3) values ('','','');
```
Error: CHECK constraint failed: tab