[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] regular expression in check constraint?
From:       "Keith Medcalf" <kmedcalf () dessus ! com>
Date:       2015-11-25 13:33:03
Message-ID: f2ebfd8db8a55e4984e9dfb328e53648 () mail ! dessus ! com
[Download RAW message or body]


REGEXP is not builtin.  You have to compile it in yourself.

> -----Original Message-----
> From: sqlite-users-bounces@mailinglists.sqlite.org [mailto:sqlite-users-
> bounces@mailinglists.sqlite.org] On Behalf Of James Hartley
> Sent: Tuesday, 24 November, 2015 15:37
> To: General Discussion of SQLite Database
> Subject: [sqlite] regular expression in check constraint?
> 
> I would like to add a check constraint which determines if a string
> contains all digits, ie.
> 
> sqlite> select zip_code from zip_codes where regexp(zip_code,
> '^[[:digit:]]+$');
> 
> However, this generates the error:
> 
> Error: no such function: regexp
> 
> Searching through sqlite.org points that this function may not be
> included.
> 
> So, is there any equivalent to this kind of functionality?  I can check at
> the application level beforehand, but there is some solace knowing that
> the
> database can check the condition at the time of insertion too.
> 
> Thanks!
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic