Re: [sqlite] Check Constraint

2018-06-12 Thread Cecil Westerhof
2018-06-12 12:38 GMT+02:00 Clemens Ladisch : > Cecil Westerhof wrote: > > I want to create a field that only has values that consist of letters, > > numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. > > What is the best way to write this check constraint? > > The GLOB opera

Re: [sqlite] Check Constraint

2018-06-12 Thread David Burgess
my guess check( your_col NOT GLOB '[@%$!]" ' ) On Tue, Jun 12, 2018 at 7:50 PM, Cecil Westerhof wrote: > I want to create a field that only has values that consist of letters, > numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. > What is the best way to write this check

Re: [sqlite] Check Constraint

2018-06-12 Thread Clemens Ladisch
Cecil Westerhof wrote: > I want to create a field that only has values that consist of letters, > numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. > What is the best way to write this check constraint? The GLOB operator has inverted character classes. So the field is vali

[sqlite] Check Constraint

2018-06-12 Thread Cecil Westerhof
I want to create a field that only has values that consist of letters, numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. What is the best way to write this check constraint? -- Cecil Westerhof ___ sqlite-users mailing list sqlite

Re: [sqlite] check constraint

2014-02-25 Thread Clemens Ladisch
d b wrote: > I would like to add check constraint for existing database. Is it > possible? SQLite has no built-in function (such as ALTER TABLE) to do this. However, if you want to do a change that does not affect how the table's data is stored in the database file, then you can change the tabl

[sqlite] check constraint

2014-02-25 Thread d b
Hi, I would like to add check constraint for existing database. Is it possible? for ex: create table emp(id integer primary key autoincrement, fullname,fathername,mothername as text); insert into emp(fullname,fathername,mothername) values("a","b","c"); insert into emp(fullname,fathernam

[sqlite] check constraint error message

2010-06-01 Thread Andrea Galeazzi
Is it possible to have a custom check constraint error message? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Check constraint problem

2010-03-01 Thread Jay A. Kreibich
On Mon, Mar 01, 2010 at 02:06:05PM -0600, Jay A. Kreibich scratched on the wall: > Also, it is highly unlikely the expression "parent == NULL" does what > you want, given that it will *always* return NULL. Try "parent IS > NOT NULL". Er... I mean "parent IS NULL". -j -- Jay A. Kre

Re: [sqlite] Check constraint problem

2010-03-01 Thread Jay A. Kreibich
On Mon, Mar 01, 2010 at 06:47:41PM +0300, ?? ?? scratched on the wall: > Hello! > > I need to check if parent of group is exist or not. > Parent stored in "parent" column and may be NULL or will be existing > "idgroup" column value. > It does not works because subqueries

Re: [sqlite] Check constraint problem

2010-03-01 Thread Pavel Ivanov
Did you consider using foreign keys (assuming you have the latest version of SQLite)? Pavel On Mon, Mar 1, 2010 at 10:47 AM, Артемий Васюков wrote: > Hello! > > I need to check if parent of group is exist or not. > Parent stored in "parent" column and may be NULL or will be existing > "idgroup"

[sqlite] Check constraint problem

2010-03-01 Thread Артемий Васюков
Hello! I need to check if parent of group is exist or not. Parent stored in "parent" column and may be NULL or will be existing "idgroup" column value. It does not works because subqueries prohibited in CHECK constraints. My table showed below (incorrect constraint commented). --