cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Akhtar <ali.rac...@gmail.com>
Subject Specifying multiple conditions for lightweight conditions?
Date Tue, 01 Nov 2016 12:22:31 GMT
In the following query:

UPDATE project SET last_due_at = '2013-01-01 00:00:00+0200'
WHERE id = '1'
IF last_due_at < '2013-01-01 00:00:00+0200';

The intent is to change the value of 'last_due_at' as long as 'last_due_at'
isn't already set to a later date than the one I've supplied.

The problem is, last_due_at starts off with an initial value of null, so
the above query fails.

If I try the following:


UPDATE project SET last_due_at = '2013-01-01 00:00:00+0200'
WHERE id = '1'
IF last_due_at < '2013-01-01 00:00:00+0200' OR last_due_at = null;

That fails due to a syntax error.

Is there any other way to achieve this?

Mime
View raw message