[sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Paul van Helden
Hi, Is this correct? Should update triggers not only fire for actual changes? I have a large table with a column which contains all NULL values except for 4. I expected an UPDATE table SET column=NULL to only fire 4 triggers, except it fires for every row. Thanks, Paul.

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Yuriy Kaminskiy
Paul van Helden wrote: Is this correct? Should update triggers not only fire for actual changes? I have a large table with a column which contains all NULL values except for 4. I expected an UPDATE table SET column=NULL to only fire 4 triggers, except it fires for every row. I'm pretty sure

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
On Tue, Jul 03, 2012 at 01:32:14PM +0200, Paul van Helden scratched on the wall: Hi, Is this correct? Should update triggers not only fire for actual changes? I have a large table with a column which contains all NULL values except for 4. I expected an UPDATE table SET column=NULL to only

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Paul van Helden
You are right, sorry, just checked. sqlite3_changes returns number of records hit, not changed. Have been using sqlite for 2 years now and was always under the impression this was for actual changes. But which is better behaviour, reporting row hits versus real changes? Especially when it comes

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Paul van Helden
The statement UPDATE table SET column=NULL updates every row in the table. The fact that some rows may already have a NULL in that column is not important. Well, it is important to me, the word change means before != after :-) ___

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Black, Michael (IS)
for all rows even if sqlite3_changes returns 0 You are right, sorry, just checked. sqlite3_changes returns number of records hit, not changed. Have been using sqlite for 2 years now and was always under the impression this was for actual changes. But which is better behaviour, reporting row hits versus

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Paul van Helden
On Tue, Jul 3, 2012 at 2:43 PM, Paul van Helden p...@planetgis.co.zawrote: The statement UPDATE table SET column=NULL updates every row in the table. The fact that some rows may already have a NULL in that column is not important. Well, it is important to me, the word change means

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Paul van Helden
On Tue, Jul 3, 2012 at 2:45 PM, Black, Michael (IS) michael.bla...@ngc.comwrote: What's better is that it tells you what you asked for...not what you think you asked for...which it does. I asked for changes :-) You've already been shown the correct solution...a WHERE clause... I've done

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Black, Michael (IS)
, July 03, 2012 7:47 AM To: j...@kreibi.ch; General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0 On Tue, Jul 3, 2012 at 2:43 PM, Paul van Helden p...@planetgis.co.zawrote: The statement UPDATE table SET column=NULL

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Paul van Helden
On Tue, Jul 3, 2012 at 3:03 PM, Black, Michael (IS) michael.bla...@ngc.comwrote: And Oracle says the opposite: Yet they all give the same answer when done with update testtable set testrow=null where testrow not null; You keep hammering this one, it is obvious, I understand, THANKS! What

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Pavel Ivanov
On Tue, Jul 3, 2012 at 9:21 AM, Paul van Helden p...@planetgis.co.za wrote: So rather than holding your breath for Oracle to change I'd recommend you do it the portable way. I'm not waiting for anything. My last question was simple: which is better? Since MySQL does it the correct way perhaps

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
On Tue, Jul 03, 2012 at 02:43:29PM +0200, Paul van Helden scratched on the wall: The statement UPDATE table SET column=NULL updates every row in the table. The fact that some rows may already have a NULL in that column is not important. Well, it is important to me, the word

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Pavel Ivanov
On Tue, Jul 3, 2012 at 10:55 AM, Jay A. Kreibich j...@kreibi.ch wrote: On Tue, Jul 03, 2012 at 02:43:29PM +0200, Paul van Helden scratched on the wall: The statement UPDATE table SET column=NULL updates every row in the table. The fact that some rows may already have a NULL in that

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
On Tue, Jul 03, 2012 at 03:21:57PM +0200, Paul van Helden scratched on the wall: On Tue, Jul 3, 2012 at 3:03 PM, Black, Michael (IS) michael.bla...@ngc.comwrote: And Oracle says the opposite: Yet they all give the same answer when done with update testtable set testrow=null where

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Paul van Helden
Then why do you keep hammering on the idea that SQLite is somehow incorrect or wrong? You've explained what you're trying to do. We've explained there is a better way to do that, that also happens to provide the correct answer on all platforms, AND likely runs faster--