use "" as an array key

Bob Sneidar bobsneidar at iotecdigital.com
Tue Oct 4 15:21:35 EDT 2016


sqlYoga handles sql NULL by converting them to the string "NULL". When writing back to the table it handles that too. the difference in where clauses is that you cannot use equal (=) as an operator. You have to use "is". Also I think in an insert or update statement in the set clause you have to use the NULL constant and not enclose in single quotes 'NULL' which would be the string.

Bob S


On Sep 24, 2016, at 24:35 , Peter TB Brett <peter.brett at livecode.com<mailto:peter.brett at livecode.com>> wrote:

On 24/09/2016 04:26, Kay C Lan wrote:
On Fri, Sep 23, 2016 at 2:27 AM, Peter TB Brett
<peter.brett at livecode.com<mailto:peter.brett at livecode.com>> wrote:

"" isn't "the absence of a string", it's a string that's 0 characters long.
Being able to use it as an array key is important for being able to
represent real-world data in an array.

It's an important point that "", a 0 character string is not the same
as NULL because we as humans often 'see them' as the same.

Very confusingly, "null" in LiveCode Script is _not_ the same as "NULL" in SQL.

In LiveCode, "null" is shorthand for "numtochar(0)".

LiveCode Script doesn't really have the concept of "no value at all" that is modelled by SQL's "NULL".  Most of the syntax fakes it by using the empty string, but unfortunately that doesn't work everywhere.

LiveCode Builder has "nothing", which is a proper "no value".

                                 Peter

--
Dr Peter Brett <peter.brett at livecode.com<mailto:peter.brett at livecode.com>>
LiveCode Technical Project Manager

lcb-mode for Emacs: https://github.com/peter-b/lcb-mode




More information about the use-livecode mailing list