Ok, I have figured out that I do not have null values on the data of my
table, even though I do have empty strings. Here is my schema,
sqlite>
sqlite> .schema
CREATE TABLE LSOpenJobs
(
id integer primary key, ProjID integer, parent, children, login,
cust, proj, PClass, PSubClass, bdate, ddate, edate, pm, pmuk, lang, vendor,
vEmail, invoice, ProjFund, A_No, wDir, BiliDir, TMDir, DeliveryDir, paid,
notes, status
);
And here is a call for a SELECT for a null value:
sqlite> select * from LSOpenJobs where notes IS NULL;
sqlite>
Now, I know for a fact that there are notes empty on some of the records
there. Why is sqlite thinking that I do not have null values?
----- Original Message -----
From: "jose isaias cabrera" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Saturday, March 10, 2007 11:40 PM
Subject: [sqlite] UPDATE colomns based on their values
Greetings!
So, I would like to update some columns based on whether or not they are
null. Some of you folks have helped me with ifnull and IS NULL, and I
happened to see coalesce, but none of these are working. If I set the
value, they will work, but with the checks, they do not get UPDATEd.
Here is the call:
BEGIN;
UPDATE LSOpenJobs SET bdate = '2007-03-02' WHERE ProjID = '215' AND bdate
IS NULL;
UPDATE LSOpenJobs SET ddate = coalesce(ddate, '2007-03-05') WHERE ProjID =
'215';
UPDATE LSOpenJobs SET edate = ifnull(edate,'2007-03-05') WHERE ProjID =
'215';
COMMIT;
As you can see, I am using 3 different checks and none of these are
working. I know it's something simple, but what it is?
Any ideas?
Maybe the other question is, what defines "IS NULL" or "ifnull" or
"coalesce"?
thanks,
josé
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------