Anomoly when storing empty values into SQLite integer fields
Bob Sneidar
bobs at twft.com
Wed Feb 22 13:28:42 EST 2012
Forgive me if I misunderstand, but I was under the impression that empty and NULL are two different things. I just updated a column in a mySQL table from LC with the value NULL (not enclosed in quotes) and when I checked the table, the value was NULL, not an empty string, as I would expect. If I had passed it an empty string I would expect it to be an empty string, not the NULL value. I am not sure if sqLite works the same way, but I cannot conceive of how it would not.
Bob
On Feb 22, 2012, at 9:43 AM, Pete wrote:
> No problem Mark. I've come across other anomalies in the way LC handles
> databases over the last few months.
>
> The bug report numbers are 10022 for the empty/zero problem and 10023 for
> the incorrect handling of the reserved keyword NULL.
>
> Pete
>
> On Wed, Feb 22, 2012 at 7:07 AM, Mark Smith <Mark_Smith at cpe.umanitoba.ca>wrote:
>
>> Peter, very cool. I'm going to have fun with that one. LC is very powerful
>> at
>> times. Oh, and thanks for posting to the bug list. While it is possible
>> that
>> RR will say this behavior conforms to a particular standard and you just
>> have to code for it (as you have below) its still way, way to much work for
>> a supposed high level rapid application development environment. My 2 cents
>> anyway.
>>
>> Cheers,
>>
>> -- Mark
>>
>>
>> Peter Haworth-2 wrote
>>>
>>> Hi Mark,
>>> I think this may not be difficult. Turns out you can use an array with
>>> numbered keys instead of a list of variables with revExecuteSQL, so
>> here's
>>> some code ( completely untested)
>>>
>>> put 1 into x
>>> put "UPDATE test SET " into mySQL
>>> repeat for each item myField in "One,Two,Three"
>>> if field myField is not empty then
>>> put myField & "=:" & x & comma after mySQL
>>> put field myField into myArray[x]
>>> add 1 to x
>>> end if
>>> end repeat
>>> put space into char -1 of mySQL
>>> put "where ID=" & tID after mySQL
>>> revExecuteSQL gConnectID, mySQL, myArray
>>>
>>> Shouldn't be too hard to generalise it as a command/function if
>> necessary.
>>>
>>>
>>
>>
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4410631.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>
>
> --
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list