sql - can check and default constraint work together in sqlite -


i trying check @ time of creating table if field 'undefined' change blank space ' '. -

create table (   id real primary key, name text check(*** if field 'undefined' change  ' ' ****) ); 

you can create trigger task -

create trigger insert_table_name  before insert on table_name each row when new.text = 'undefined' begin new.text:= ''; end; 

and in case want other task can perform in trigger.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -