RB Smissaert wrote:
I am sure this SQL used to be fine with SQLite:
update table1
set
field1 = 0 where field1 = 2,
field2 = 3 where field2 = 2
Now however I get a syntax error near ,
Has this changed?
RBS
Does the thread below ring a bell? Does it help?
Gerry
---------------------------------------------------------------------------------------------------
Yes, thanks, that works indeed.
RBS
-----Original Message-----
From: Igor Tandetnik [mailto:[EMAIL PROTECTED]
Sent: 11 March 2007 02:55
To: SQLite
Subject: [sqlite] Re: What is wrong with this UPDATE?
RB Smissaert <[EMAIL PROTECTED]>
wrote:
> UPDATE
> A3SQLADC_J
> SET
> ADDED_DATE = '' WHERE ADDED_DATE = 0 OR ADDED_DATE IS NULL,
> START_DATE = '' WHERE START_DATE = 0 OR START_DATE IS NULL
>
> near ",": syntax error
Make it
UPDATE
A3SQLADC_J
SET
ADDED_DATE = (case when ADDED_DATE = 0 OR ADDED_DATE IS NULL then ''
else ADDED_DATE end),
START_DATE = (case when START_DATE = 0 OR START_DATE IS NULL then ''
else START_DATE end);
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------