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
. 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
.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
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
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
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
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
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
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
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
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
-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
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
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
-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
:
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
, 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
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
:)
-- 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
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
.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
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
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
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
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
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
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
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.
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
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
). 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
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
-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
... 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
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
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
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
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
= 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
://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
-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
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
.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
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
, 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
45 matches
Mail list logo