No. All SQL functions can safely take NULL as an argument. LENGTH(NULL) returns NULL, so LENGTH(NULL) = 0 is always false.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Rob Richardson Sent: Thursday, May 23, 2013 3:34 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite NULL or 0-Length Simon, Is there a danger here if firstname is NULL and the LENGTH() function is called first? RobR -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Simon Slavin Sent: Thursday, May 23, 2013 2:54 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite NULL or 0-Length On 23 May 2013, at 7:06pm, Jill Rabinowitz <[email protected]> wrote: > Does anyone know how I can check the column and set it to a value if > it has nothing in it? UPDATE myTable SET firstname='xxx' WHERE LENGTH(firstname) = 0 OR firstname IS NULL Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users This email and any attachments are only for use by the intended recipient(s) and may contain legally privileged, confidential, proprietary or otherwise private information. Any unauthorized use, reproduction, dissemination, distribution or other disclosure of the contents of this e-mail or its attachments is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete the original. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

