SQLite Forum

how to refuse write empty value
Login
Without seeing the constraints you summarized, I cannot venture what went wrong with them.  Done right, that may be the best solution.

Also, I'm obliged to mention: If you do not check those %val?% inputs carefully before using them in some DML, you have exposed yourself (or your client/employer) to SQL injection woes.  

And if you are checking them, why not detect empty values there?

Did you know that "windows shell script" could refer either to command.exe input or Powershell input?  If you used Powershell, complex code (such as checking inputs carefully) would be nowhere near as tedious to write (and debug.)

Now, getting to SQL and/or SQLite ...

If you have a working NOT NULL constraint, you could use, as the insert value, an expression which resolves to NULL for an empty string literal. You have not done that; instead you are inserting empty TEXT values (which are not NULLs.)

See the [CASE ... WHEN ...](https://sqlite.org/lang_expr.html) syntax for how to write such expressions.