Re: [sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread Daniel Polski
Replace != with IS NOT. Regards, Clemens Thanks! Exactly what I looked for. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread rhuijben
> -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On > Behalf Of R Smith > Sent: donderdag 13 oktober 2016 17:37 > To: sqlite-users@mailinglists.sqlite.org > Subject: Re: [sqlite] Trigger WHEN condition, comparing with null

Re: [sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread R Smith
On 2016/10/13 1:09 PM, Hick Gunter wrote: (new.value != old.value) or (new.value IS NULL) or (old.value IS NULL) This will test true for a condition where new.value and old.value are both NULL (so technically not different), which may or may not be what the OP wanted. __

Re: [sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread Hick Gunter
] Trigger WHEN condition, comparing with null Thank you, I see. Any suggestion how to get the trigger to fire if (and only if) the values are different, including if one of the "sides" of old/new are null? Den 2016-10-13 kl. 11:56, skrev Kees Nuyt: > On Thu, 13 Oct 2016 11:45:14

Re: [sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread Clemens Ladisch
Daniel Polski wrote: > Any suggestion how to get the trigger to fire if (and only if) the > values are different, including if one of the "sides" of old/new are > null? Replace != with IS NOT. Regards, Clemens ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread Daniel Polski
Thank you, I see. Any suggestion how to get the trigger to fire if (and only if) the values are different, including if one of the "sides" of old/new are null? Den 2016-10-13 kl. 11:56, skrev Kees Nuyt: On Thu, 13 Oct 2016 11:45:14 +0200, Daniel Polski wrote: That's because the expression in

Re: [sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread Kees Nuyt
On Thu, 13 Oct 2016 11:45:14 +0200, Daniel Polski wrote: That's because the expression in the WHEN clause (new.value != old.value) is not valid when one of them is NULL. HTH -- Regards, Kees Nuyt >Hello, >I guess there is something I'm missing when trying to synchronize some >data

[sqlite] Trigger WHEN condition, comparing with null

2016-10-13 Thread Daniel Polski
Hello, I guess there is something I'm missing when trying to synchronize some data with a trigger. How do I get the trigger to fire when the comparison in either new.x or old.x is null? The below tested with 3.8.6 sqlite command line shell: CREATE TABLE table1( idINTEGER PRIMARY K