Re: Anomoly when storing empty values into SQLite integer fields

2012-02-24 Thread Bob Sneidar
For basic things, using SQL to check for consistency is acceptable I suppose. But how would you use SQL to verify a phone number was properly formatted based upon whether or not it was international? How about a valid zip code depending on the country? How about a reservation, making sure it

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Bob Sneidar
. It does this for any SQLite field type. (3) When you read it back, if the SQlite field is an integer LC displays a zero, if the SQLite field is text, then LC leaves it as an empty string. -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Smith
.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4414587.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Wieder
Bob Sneidar bobs@... writes: I just tested this with a numeric column in mySQL. The column has NOT NULL unchecked and the default value set to NULL. When I updated from LC setting the column to NULL that is the value that the column was set to. HOWEVER if I updated the column with an empty

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Smith
the number of elements in myArray after msg -- debug go card forms end mouseup -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4414775.html Sent from the Revolution - User mailing list

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Smith
of the help here. Cheers, -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4414784.html Sent from the Revolution - User mailing list archive at Nabble.com

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Pete
Hi Mark, I didn't get a chance to test this code so sorry, yes, the array name should be quoted. I'm not sure why the rest of it isn't working though. If you look at the array in debug, you should see its keys being 1,2, etc and the value of each key being the value of the field, not the name of

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Schonewille
Hi, In SQL land, empty doesn't exist. Whenever you want a value to be empty, you must set the value to null. Be careful: in SQLite null is not NULL (I can never remember which one I need; you'll have to try). Note that if you're doing a query on fields that contain null values, those records

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Smith
of field myField into myArray[x]. Ok now I get it, thanks (this makes sense, particularly after I went back and reread the revExecuteSQL dictionary entry carefully). -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Bob Sneidar
Using numToChar(0) from within LC puts NULL into the column. I hope that clears it up a bit more. Bob On Feb 23, 2012, at 10:08 AM, Mark Wieder wrote: Bob Sneidar bobs@... writes: I just tested this with a numeric column in mySQL. The column has NOT NULL unchecked and the default

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Smith
to code, so this little snippet is going to save a TON of time. I've really appreciated the discussion. -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4415011.html Sent from the Revolution

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Smith
-empty-values-into-SQLite-integer-fields-tp4408942p4415024.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Pete
Here's an illustration of how null works in sqlite, using sqlite3, the official command line tool for sqlite admin and therefore most likely to work correctly. You can also go to http://www.sqlite.org/nulls.html for a write up on how null is treated in various sqlite expressions. First create a

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Bob Sneidar
For the sake of satisfying my own curiosity, I just used the Firefox sqLite manager to open an sqLite db file. I added a column to a table for testing purposes, called bobnum integer default NULL. When browsing, the column indicates it's value is Null. But when I update a row using update

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Mark Smith
-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4415835.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Pete
: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4415835.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-23 Thread Bob Sneidar
, check out #3 in the SQLite FAQ http://www.sqlite.org/faq.html#q3 Cheers, - Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4415835.html Sent from the Revolution - User mailing list

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Mark Smith
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

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Bob Sneidar
:) -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409186.html Sent from the Revolution - User mailing list archive at Nabble.com

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Robert Brenstein
On 21.02.2012 at 19:46 Uhr -0800 Mark Smith apparently wrote: Which sort of works, until you consider the case of wanting to back out a value (revert from some value to NULL). At present, I think I'll just stick with using text fields, but we should definitely report this to RR. If the user

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Pete
.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@lists.runrev.com Please visit this url

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Bob Sneidar
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

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Bob Sneidar
It may be a small distinction, but NULL is ASCII 0. An empty string is nothing at all, so far as I know. To a human this is splitting hairs, but to a computer all hairs must be split. Bob On Feb 22, 2012, at 8:58 AM, Robert Brenstein wrote: On 21.02.2012 at 19:46 Uhr -0800 Mark Smith

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Pete
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

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Bob Sneidar
Ok. But if it really were the string value NULL that gets saved to the database, wouldn't you get NULL in your select statement?? Try using a lowercase null in your update statement, then view the sqLite table with a utility to see what it says the value is. If it's capital NULL it is actually

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Bob Sneidar
Allow me to expand on the subject a bit with a couple methods I use when working with databases. First method is this. When I am working with a record from a table, I store all the column values in an array whose keys are the column names. If I am inserting a new record, I manually create the

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Pete
Bob, Sorry but you're wrong on all counts. Read my earlier mails for info In particular, LC is not retuning empty for a NULL value in an integer column - it's returning zero, that's where this whole mess started!!! I am quite happy for it to return empty for a NULL value but that's not what is

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Bob Sneidar
I just tested this with a numeric column in mySQL. The column has NOT NULL unchecked and the default value set to NULL. When I updated from LC setting the column to NULL that is the value that the column was set to. HOWEVER if I updated the column with an empty string, I got 0 just as you say.

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Mark Smith
in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4412904.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-22 Thread Mark Smith
this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4412919.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use

Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith
). I think LC is doing the translation on integer type fields but….. I'm not 100% sure of that. Your thoughts? (I'm using 5.0.2 for these tests) -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
the translation on integer type fields but….. I'm not 100% sure of that. Your thoughts? (I'm using 5.0.2 for these tests) -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4408942.html

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
-empty-values-into-SQLite-integer-fields-tp4408942p4408942.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith
... but what should that be (I want undefined to remain undefined)? -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html Sent from the Revolution - User mailing list archive

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith
fields... etc -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409110.html Sent from the Revolution - User mailing list archive at Nabble.com

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
record using the same code. Bob may be on to something though maybe I have to define a default... but what should that be (I want undefined to remain undefined)? -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
the same code. Bob may be on to something though maybe I have to define a default... but what should that be (I want undefined to remain undefined)? -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
characters in text fields... etc -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409110.html Sent from the Revolution - User mailing list archive at Nabble.com

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
= tID into tCmd -- old format But then you have to worry about escaping characters in text fields... etc -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409110.html Sent from

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith
-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409145.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Bob Sneidar
in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409072.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith
.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields-tp4408942p4409162.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Mark Smith
should be able to use empty or NULL to signal that (I have no preference... to my failing eyesight they both look equally missing to me :) -- Mark -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values-into-SQLite-integer-fields

Re: Anomoly when storing empty values into SQLite integer fields

2012-02-21 Thread Pete
, thats enough of a hint... I can work something up from there. If fldone is not empty then put some string after the string I'm trying to build should do it. Thanks -- M -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Anomoly-when-storing-empty-values