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

> -----Original Message-----
> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-
> bounces at 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 at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



Reply via email to