List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:January 14 2000 2:51pm
Subject:Failure with UPDATE statement
View as plain text  
>>>>> "Peter" == Peter Campbell <pc@stripped> writes:

Peter> The following statement does nothing and I don't know why;

Peter> UPDATE MASTER SET QTY_ON_HAND = 0 WHERE COMPANY_ID = 
Peter> '01';

Peter> The results are as follows:

Peter> Query Ok, 1 rows affected (2.13 sec)
Peter> Rows matched: 13105  Changed: 1  Warnings: 0

Peter> The current value in the field {numeric (12,2)} is NULL and MySql 
Peter> doesn't want to update the value to 0.

Peter> (I don't know if there is anything special about the 1 record that did 
Peter> get updated).

Peter> If I update the field to any value other than 0, eg: 10 the update 
Peter> works fine and then I can run the update setting the value = 0 ok 
Peter> too.

Peter> The update command doesn't distinguish between 0 and NULL for 
Peter> the numeric fields?

Peter> version: Mysql 3.23.5-alpha.

Hi!

Please try MySQL 3.23.8;  If this doesn't work, try to make a full
example that shows this (I can't repeat this problem with my MySQL
version).

Regards,
Monty
Thread
Failure with UPDATE statementPeter Campbell14 Jan
  • Re: Failure with UPDATE statementSasha Pachev14 Jan
  • Re: Failure with UPDATE statementsinisa14 Jan
  • Failure with UPDATE statementMichael Widenius14 Jan
Re: Failure with UPDATE statementMichael Widenius19 Jan