Re: update doesn't

2012-08-20 Thread Mogens Melander

On Sun, August 19, 2012 18:19, william drescher wrote:
 On 8/17/2012 12:13 PM, Rik Wasmus wrote:
 I get 1 row affected, but the status does not change when I look
 at the row.

 If I set it to 'X' it does change.

 To make it even more wacky, if I (using phpMyAdmin) change it to
 'H' it will change and the row is shown change, but when I go to
 examine the row (using the pencil icon=Edit) it changes back to 'W'.

 Either there is something really strange or my mysql is possessed.

 I am using Server version: 5.1.63-0ubuntu0.10.04.

 Anyone have any thoughts about this or suggestions on how to
 debug it?

 1) One thing that _could_ do this is a trigger. Does SHOW TRIGGERS; show
 any
 that could be doing this?

 2) However, in 99.999% of cases, it is just a logic error in the
 application
 (be it your application or PHPMyAdmin), not anything in MySQL. Can you
 connect
 with the command line client, run the UPDATE statement, en then check
 what the
 SELECT shows? If it shows a correct result... the problem ain't in MySQL
 itself.

 mysql select status from tasks;
 ++
 | status |
 ++
 | W  |
 ++
 1 row in set (0.00 sec)

 mysql update tasks set status= 'H';
 Query OK, 1 row affected (0.00 sec)
 Rows matched: 1 Changed 1 Warnings: 0

 mysql select status from tasks;
 ++
 | status |
 ++
 | W  |
 ++
 1 row in set (0.00 sec)

 whoops

 bill


Maybe a SHOW CREATE TABLE `tasks`\g could shed some light.

-- 
Mogens Melander
+66 8701 33224

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: update doesn't

2012-08-20 Thread william drescher

On 8/20/2012 10:09 AM, Mogens Melander wrote:


On Sun, August 19, 2012 18:19, william drescher wrote:

On 8/17/2012 12:13 PM, Rik Wasmus wrote:

I get 1 row affected, but the status does not change when I look
at the row.

If I set it to 'X' it does change.

To make it even more wacky, if I (using phpMyAdmin) change it to
'H' it will change and the row is shown change, but when I go to
examine the row (using the pencil icon=Edit) it changes back to 'W'.

Either there is something really strange or my mysql is possessed.

I am using Server version: 5.1.63-0ubuntu0.10.04.

Anyone have any thoughts about this or suggestions on how to
debug it?


1) One thing that _could_ do this is a trigger. Does SHOW TRIGGERS; show
any
that could be doing this?

2) However, in 99.999% of cases, it is just a logic error in the
application
(be it your application or PHPMyAdmin), not anything in MySQL. Can you
connect
with the command line client, run the UPDATE statement, en then check
what the
SELECT shows? If it shows a correct result... the problem ain't in MySQL
itself.


mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

mysql update tasks set status= 'H';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed 1 Warnings: 0

mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

whoops

bill



Maybe a SHOW CREATE TABLE `tasks`\g could shed some light.

I can't figure out how to get puTTY to log the session so I can't 
cut and paste the output, but here is a phpMySQL export of the 
table with the extra stuff typed in from the create table


task_id mediumint(9) NOT NULL AUTO_INCREMENT
status char(1) NOT NULL DEFAULT ''
priority char(1) NOT NULL
due_date_time datetimeNOT NULL
hold_date_time datetime NOT NULL
review_date_time datetime  Default NULL
requestor varchar(10) NOT NULL
performer varchar(10) NOT NULL
repeat_frequency char(1) NOT NULL
repeat_time char(2) NOT NULL
repeat_from char(1) NOT NULL
task_title varchar(60) NOT NULL
description text Yes NULL
history text Yes NULL
function_to_run varchar(80) DEFAULT NULL
last_access datetime NOT NULL
completed datetime NOT NULL
notify tinyint(1) DEFAULT NULL

PRIMARY kEY('TASK_ID')
UNIQUE KEY 'performer' ('performer', 'status', priority', 
due_date_time', 'task_id')
UNIQUE KEY 'requestor' ('requestor', prirority','due_date_time', 
'task_id')

ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=ascii

As a workaround I changed status to task_status and now it 
works just fine.



bill


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: update doesn't

2012-08-19 Thread william drescher

On 8/17/2012 12:13 PM, Rik Wasmus wrote:

I get 1 row affected, but the status does not change when I look
at the row.

If I set it to 'X' it does change.

To make it even more wacky, if I (using phpMyAdmin) change it to
'H' it will change and the row is shown change, but when I go to
examine the row (using the pencil icon=Edit) it changes back to 'W'.

Either there is something really strange or my mysql is possessed.

I am using Server version: 5.1.63-0ubuntu0.10.04.

Anyone have any thoughts about this or suggestions on how to
debug it?


1) One thing that _could_ do this is a trigger. Does SHOW TRIGGERS; show any
that could be doing this?

2) However, in 99.999% of cases, it is just a logic error in the application
(be it your application or PHPMyAdmin), not anything in MySQL. Can you connect
with the command line client, run the UPDATE statement, en then check what the
SELECT shows? If it shows a correct result... the problem ain't in MySQL
itself.


mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

mysql update tasks set status= 'H';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed 1 Warnings: 0

mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

whoops

bill





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: update doesn't

2012-08-19 Thread Johnny Withers
The client indicates a warning after the update. Issue a show warnings
after the update.
On Aug 19, 2012 11:19 AM, william drescher will...@techservsys.com
wrote:

 On 8/17/2012 12:13 PM, Rik Wasmus wrote:

 I get 1 row affected, but the status does not change when I look
 at the row.

 If I set it to 'X' it does change.

 To make it even more wacky, if I (using phpMyAdmin) change it to
 'H' it will change and the row is shown change, but when I go to
 examine the row (using the pencil icon=Edit) it changes back to 'W'.

 Either there is something really strange or my mysql is possessed.

 I am using Server version: 5.1.63-0ubuntu0.10.04.

 Anyone have any thoughts about this or suggestions on how to
 debug it?


 1) One thing that _could_ do this is a trigger. Does SHOW TRIGGERS; show
 any
 that could be doing this?

 2) However, in 99.999% of cases, it is just a logic error in the
 application
 (be it your application or PHPMyAdmin), not anything in MySQL. Can you
 connect
 with the command line client, run the UPDATE statement, en then check
 what the
 SELECT shows? If it shows a correct result... the problem ain't in MySQL
 itself.

  mysql select status from tasks;
 ++
 | status |
 ++
 | W  |
 ++
 1 row in set (0.00 sec)

 mysql update tasks set status= 'H';
 Query OK, 1 row affected (0.00 sec)
 Rows matched: 1 Changed 1 Warnings: 0

 mysql select status from tasks;
 ++
 | status |
 ++
 | W  |
 ++
 1 row in set (0.00 sec)

 whoops

 bill





 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql




Re: update doesn't

2012-08-19 Thread william drescher

On 8/19/2012 1:25 PM, Johnny Withers wrote:

The client indicates a warning after the update. Issue a show warnings
after the update.


actually, it doesn't.
but I did a show warnings and it replied: Empty Set (0.00 sec)
I also did a show triggers and it replied: Empty Set (0.00 sec)


On Aug 19, 2012 11:19 AM, william drescher will...@techservsys.com
wrote:


On 8/17/2012 12:13 PM, Rik Wasmus wrote:


I get 1 row affected, but the status does not change when I look

at the row.

If I set it to 'X' it does change.

To make it even more wacky, if I (using phpMyAdmin) change it to
'H' it will change and the row is shown change, but when I go to
examine the row (using the pencil icon=Edit) it changes back to 'W'.

Either there is something really strange or my mysql is possessed.

I am using Server version: 5.1.63-0ubuntu0.10.04.

Anyone have any thoughts about this or suggestions on how to
debug it?



1) One thing that _could_ do this is a trigger. Does SHOW TRIGGERS; show
any
that could be doing this?

2) However, in 99.999% of cases, it is just a logic error in the
application
(be it your application or PHPMyAdmin), not anything in MySQL. Can you
connect
with the command line client, run the UPDATE statement, en then check
what the
SELECT shows? If it shows a correct result... the problem ain't in MySQL
itself.

  mysql select status from tasks;

++
| status |
++
| W  |
++
1 row in set (0.00 sec)

mysql update tasks set status= 'H';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed 1 Warnings: 0

mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

whoops

bill





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql








--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: update doesn't

2012-08-19 Thread william drescher

On 8/19/2012 5:56 PM, william drescher wrote:


  mysql select status from tasks;

++
| status |
++
| W  |
++
1 row in set (0.00 sec)

mysql update tasks set status= 'H';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed 1 Warnings: 0

mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

whoops

bill





further information - interesting, it will accept X but not H
  mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

mysql update tasks set status= 'X';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed 1 Warnings: 0

mysql select status from tasks;
++
| status |
++
|  X |
++
1 row in set (0.00 sec)


mysql update tasks set status= 'H';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed 1 Warnings: 0

mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

whoops


However, If I fully qualify the col name it works.


   mysql select status from tasks;
++
| status |
++
| W  |
++
1 row in set (0.00 sec)

mysql update Information_server.tasks set status= 'H';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed 1 Warnings: 0

mysql select status from tasks;
++
| status |
++
| H  |
++
1 row in set (0.00 sec)

I suspect there is a problem naming a col status

bill



bill





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: update doesn't

2012-08-17 Thread Rik Wasmus
 I get 1 row affected, but the status does not change when I look
 at the row.
 
 If I set it to 'X' it does change.
 
 To make it even more wacky, if I (using phpMyAdmin) change it to
 'H' it will change and the row is shown change, but when I go to
 examine the row (using the pencil icon=Edit) it changes back to 'W'.
 
 Either there is something really strange or my mysql is possessed.
 
 I am using Server version: 5.1.63-0ubuntu0.10.04.
 
 Anyone have any thoughts about this or suggestions on how to
 debug it?

1) One thing that _could_ do this is a trigger. Does SHOW TRIGGERS; show any 
that could be doing this?

2) However, in 99.999% of cases, it is just a logic error in the application 
(be it your application or PHPMyAdmin), not anything in MySQL. Can you connect 
with the command line client, run the UPDATE statement, en then check what the 
SELECT shows? If it shows a correct result... the problem ain't in MySQL 
itself.
-- 
Rik Wasmus

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Update Doesn't Update!

2009-12-11 Thread carsten

On Fri, 11 Dec 2009 04:38:01 -0500, Victor Subervi

victorsube...@gmail.com

wrote:

 Hi;

 

 mysql update products set sizes=('Small', 'Large') where ID=0;

 Query OK, 0 rows affected, 1 warning (0.00 sec)

 Rows matched: 1  Changed: 0  Warnings: 1



Warnings: 1



do a SHOW WARNINGS immediately after you execute the stmt.



/ Carsten





 

 mysql select sizes, colorsShadesNumbersShort from products where ID=0;

 +---+--+

 | sizes | colorsShadesNumbersShort |

 +---+--+

 |   |  |

 +---+--+

 1 row in set (0.00 sec)

 

 Huh?

 TIA,

 Victor

 

 

 !DSPAM:451,4b221339930275276717544!

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread Jørn Dahl-Stamnes
On Friday 11 December 2009 10:38, Victor Subervi wrote:
 Hi;

 mysql update products set sizes=('Small', 'Large') where ID=0;
 Query OK, 0 rows affected, 1 warning (0.00 sec)
 Rows matched: 1  Changed: 0  Warnings: 1
  
Look at the message, 0 rows changed and 1 warning.
You cannot have ID=0 if ID is an index.

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 4:48 AM, Jørn Dahl-Stamnes
sq...@dahl-stamnes.netwrote:

 On Friday 11 December 2009 10:38, Victor Subervi wrote:
  Hi;
 
  mysql update products set sizes=('Small', 'Large') where ID=0;
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  Rows matched: 1  Changed: 0  Warnings: 1
   
 Look at the message, 0 rows changed and 1 warning.
 You cannot have ID=0 if ID is an index.


Yikes! Then how do I update this table? I will need to update every variable
*except* the ID, which is the primary key and an auto_increment.
V


Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 4:48 AM, Jørn Dahl-Stamnes
sq...@dahl-stamnes.netwrote:

 On Friday 11 December 2009 10:38, Victor Subervi wrote:
  Hi;
 
  mysql update products set sizes=('Small', 'Large') where ID=0;
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  Rows matched: 1  Changed: 0  Warnings: 1
   
 Look at the message, 0 rows changed and 1 warning.
 You cannot have ID=0 if ID is an index.


Yikes! Then how do I update this table? I will need to update every variable
*except* the ID, which is the primary key and an auto_increment.
V


Re: Update Doesn't Update!

2009-12-11 Thread Martijn Tonies

mysql update products set sizes=('Small', 'Large') where ID=0;
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 1

 
Look at the message, 0 rows changed and 1 warning.
You cannot have ID=0 if ID is an index.


Are you serious??

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



RE: Update Doesn't Update!

2009-12-11 Thread misiaQ
If ID column is primary key and auto increment as you said, it cant be equal
to zero.
You got a query which reads:
UPDATE columns WHERE false

There is no chance for any updates.
http://dev.mysql.com/doc/refman/5.0/en/update.html

Regards,
m

-Original Message-
From: Victor Subervi [mailto:victorsube...@gmail.com] 
Sent: 11 December 2009 10:06
Cc: mysql@lists.mysql.com
Subject: Re: Update Doesn't Update!

On Fri, Dec 11, 2009 at 4:48 AM, Jørn Dahl-Stamnes
sq...@dahl-stamnes.netwrote:

 On Friday 11 December 2009 10:38, Victor Subervi wrote:
  Hi;
 
  mysql update products set sizes=('Small', 'Large') where ID=0;
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  Rows matched: 1  Changed: 0  Warnings: 1
   
 Look at the message, 0 rows changed and 1 warning.
 You cannot have ID=0 if ID is an index.


Yikes! Then how do I update this table? I will need to update every variable
*except* the ID, which is the primary key and an auto_increment.
V


--
Szef przynudza? Zagraj sobie!
Sprawdz  http://link.interia.pl/f24e4


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 4:43 AM, cars...@bitbybit.dk wrote:


 On Fri, 11 Dec 2009 04:38:01 -0500, Victor Subervi
 victorsube...@gmail.com
 wrote:
  Hi;
 
  mysql update products set sizes=('Small', 'Large') where ID=0;
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  Rows matched: 1  Changed: 0  Warnings: 1

 Warnings: 1

 do a SHOW WARNINGS immediately after you execute the stmt.


mysql update products set sizes=('Small', 'Large') where SKU='prodSKU1';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 1

mysql show warnings;
+-+--++
| Level   | Code | Message|
+-+--++
| Warning | 1265 | Data truncated for column 'sizes' at row 1 |
+-+--++
1 row in set (0.00 sec)


What do? How do I enter multiple values?
TIA,
V


Re: Update Doesn't Update!

2009-12-11 Thread carsten

On Fri, 11 Dec 2009 10:48:59 +0100, Jørn Dahl-Stamnes

sq...@dahl-stamnes.net wrote:

 On Friday 11 December 2009 10:38, Victor Subervi wrote:

 Hi;



 mysql update products set sizes=('Small', 'Large') where ID=0;

 Query OK, 0 rows affected, 1 warning (0.00 sec)

 Rows matched: 1  Changed: 0  Warnings: 1

   

 Look at the message, 0 rows changed and 1 warning.

 You cannot have ID=0 if ID is an index.



Then how did he manage to get a matched row?



Of course you can have ID=0.



/ Carsten



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread carsten

On Fri, 11 Dec 2009 05:09:52 -0500, Victor Subervi

victorsube...@gmail.com

wrote:



 mysql update products set sizes=('Small', 'Large') where

SKU='prodSKU1';

 Query OK, 0 rows affected, 1 warning (0.00 sec)

 Rows matched: 1  Changed: 0  Warnings: 1

 

 mysql show warnings;

 +-+--++

 | Level   | Code | Message|

 +-+--++

 | Warning | 1265 | Data truncated for column 'sizes' at row 1 |

 +-+--++

 1 row in set (0.00 sec)

 

 

 What do? How do I enter multiple values?



Impossible to say, until you let us know how you defined the column in the

first place...



/ Carsten



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread Mark Goodge

Jørn Dahl-Stamnes wrote:

On Friday 11 December 2009 10:38, Victor Subervi wrote:

Hi;

mysql update products set sizes=('Small', 'Large') where ID=0;
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 1

  
Look at the message, 0 rows changed and 1 warning.
You cannot have ID=0 if ID is an index.


You can, but not if it's an auto-increment field.

Mark



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread Yang Wang
first desc products

or try to

update products set sizes='Small' where
SKU='prodSKU1';




Best Regards!
Yang Wang
 
Tel.: 0769-21687397
Fax.: 0769-21685577
Email: yw...@lfm-agile.com.hk
- Original Message - 
From: cars...@bitbybit.dk
To: Victor Subervi victorsube...@gmail.com
Cc: mysql@lists.mysql.com
Sent: Friday, December 11, 2009 6:13 PM
Subject: Re: Update Doesn't Update!


 
 On Fri, 11 Dec 2009 05:09:52 -0500, Victor Subervi
 victorsube...@gmail.com
 wrote:
 
 mysql update products set sizes=('Small', 'Large') where
 SKU='prodSKU1';
 Query OK, 0 rows affected, 1 warning (0.00 sec)
 Rows matched: 1  Changed: 0  Warnings: 1
 
 mysql show warnings;
 +-+--++
 | Level   | Code | Message|
 +-+--++
 | Warning | 1265 | Data truncated for column 'sizes' at row 1 |
 +-+--++
 1 row in set (0.00 sec)
 
 
 What do? How do I enter multiple values?
 
 Impossible to say, until you let us know how you defined the column in the
 first place...
 
 / Carsten
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql?unsub=yw...@lfm-agile.com.hk


Re: Update Doesn't Update!

2009-12-11 Thread Chris Knipe


Quoting cars...@bitbybit.dk:


Of course you can have ID=0.


Definately agree

mysql DESCRIBE test;
+-+-+--+-+-++
| Field   | Type| Null | Key | Default | Extra  |
+-+-+--+-+-++
| autoinc | int(11) | NO   | PRI | NULL| auto_increment |
| value   | varchar(10) | NO   | | NULL||
+-+-+--+-+-++
2 rows in set (0.00 sec)

mysql SELECT * FROM test;
+-++
| autoinc | value  |
+-++
|   0 | 1234567890 |
+-++
1 row in set (0.00 sec)

mysql UPDATE test SET value='a' WHERE autoinc='0';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql SELECT * FROM test;
+-+---+
| autoinc | value |
+-+---+
|   0 | a |
+-+---+
1 row in set (0.00 sec)

However, what I believe the problem is:
mysql UPDATE test set value='12345678901' WHERE autoinc='0';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql SELECT * FROM test;
+-++
| autoinc | value  |
+-++
|   0 | 1234567890 |
+-++
1 row in set (0.00 sec)

the value of value is too long for the varchar(10) in the table.  It  
thus generates the warning, and truncate the field.


The poster's table needs to be updated therefor to accept longer  
variables in the sizes column.



--

Regards,
Chris.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 5:13 AM, cars...@bitbybit.dk wrote:


 On Fri, 11 Dec 2009 05:09:52 -0500, Victor Subervi
 victorsube...@gmail.com
 wrote:

  mysql update products set sizes=('Small', 'Large') where
 SKU='prodSKU1';
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  Rows matched: 1  Changed: 0  Warnings: 1
 
  mysql show warnings;
  +-+--++
  | Level   | Code | Message|
  +-+--++
  | Warning | 1265 | Data truncated for column 'sizes' at row 1 |
  +-+--++
  1 row in set (0.00 sec)
 
 
  What do? How do I enter multiple values?

 Impossible to say, until you let us know how you defined the column in the
 first place...


Sorry. It's an enum of which the elements I am trying to add into a row are
elements of the same enum; that is, a subset.
V


Re: Update Doesn't Update!

2009-12-11 Thread carsten

On Fri, 11 Dec 2009 05:28:41 -0500, Victor Subervi

victorsube...@gmail.com

wrote:

 On Fri, Dec 11, 2009 at 5:13 AM, cars...@bitbybit.dk wrote:

 



 On Fri, 11 Dec 2009 05:09:52 -0500, Victor Subervi

 victorsube...@gmail.com

 wrote:



  mysql update products set sizes=('Small', 'Large') where

 SKU='prodSKU1';

  Query OK, 0 rows affected, 1 warning (0.00 sec)

  Rows matched: 1  Changed: 0  Warnings: 1

 

  mysql show warnings;

  +-+--++

  | Level   | Code | Message|

  +-+--++

  | Warning | 1265 | Data truncated for column 'sizes' at row 1 |

  +-+--++

  1 row in set (0.00 sec)

 

 

  What do? How do I enter multiple values?



 Impossible to say, until you let us know how you defined the column in

 the

 first place...



 

 Sorry. It's an enum of which the elements I am trying to add into a row

are

 elements of the same enum; that is, a subset.



You're using the wrong type. RTFM re. the difference between enums and

sets. 



/ Carsten

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 5:33 AM, cars...@bitbybit.dk wrote:


 On Fri, 11 Dec 2009 05:28:41 -0500, Victor Subervi
 victorsube...@gmail.com
 wrote:
  On Fri, Dec 11, 2009 at 5:13 AM, cars...@bitbybit.dk wrote:
 
 
  On Fri, 11 Dec 2009 05:09:52 -0500, Victor Subervi
  victorsube...@gmail.com
  wrote:
 
   mysql update products set sizes=('Small', 'Large') where
  SKU='prodSKU1';
   Query OK, 0 rows affected, 1 warning (0.00 sec)
   Rows matched: 1  Changed: 0  Warnings: 1
  
   mysql show warnings;
   +-+--++
   | Level   | Code | Message|
   +-+--++
   | Warning | 1265 | Data truncated for column 'sizes' at row 1 |
   +-+--++
   1 row in set (0.00 sec)
  
  
   What do? How do I enter multiple values?
 
  Impossible to say, until you let us know how you defined the column in
  the
  first place...
 
 
  Sorry. It's an enum of which the elements I am trying to add into a row
 are
  elements of the same enum; that is, a subset.

 You're using the wrong type. RTFM re. the difference between enums and
 sets.


k. Thanks,
V


Re: Update Doesn't Update!

2009-12-11 Thread Johan De Meersman
On Fri, Dec 11, 2009 at 11:19 AM, Mark Goodge m...@good-stuff.co.uk wrote:

 Jørn Dahl-Stamnes wrote:

 On Friday 11 December 2009 10:38, Victor Subervi wrote:

 Hi;

 mysql update products set sizes=('Small', 'Large') where ID=0;
 Query OK, 0 rows affected, 1 warning (0.00 sec)
 Rows matched: 1  Changed: 0  Warnings: 1

  
 Look at the message, 0 rows changed and 1 warning.
 You cannot have ID=0 if ID is an index.


 You can, but not if it's an auto-increment field.


Also, not *entirely* correct, although you have to jump through a few hoops:
it can occur if the field was changed to auto_increment *after* the 0 was
put in there.

Yes, I inherited a database like that once, and yes, it fucks up your day.


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql?unsub=vegiv...@tuxera.be




Re: Update Doesn't Update!

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 8:43 AM, Johan De Meersman vegiv...@tuxera.bewrote:

 On Fri, Dec 11, 2009 at 11:19 AM, Mark Goodge m...@good-stuff.co.uk
 wrote:

  Jørn Dahl-Stamnes wrote:
 
  On Friday 11 December 2009 10:38, Victor Subervi wrote:
 
  Hi;
 
  mysql update products set sizes=('Small', 'Large') where ID=0;
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  Rows matched: 1  Changed: 0  Warnings: 1
 
   
  Look at the message, 0 rows changed and 1 warning.
  You cannot have ID=0 if ID is an index.
 
 
  You can, but not if it's an auto-increment field.
 

 Also, not *entirely* correct, although you have to jump through a few
 hoops:
 it can occur if the field was changed to auto_increment *after* the 0 was
 put in there.

 Yes, I inherited a database like that once, and yes, it fucks up your day.


I'm lost. I set up this database originally with auto_increment and the
first value was 0. I thought that was always the case. Is there a problem
here?
V


Re: Update Doesn't Update!

2009-12-11 Thread Johan De Meersman
On Fri, Dec 11, 2009 at 6:40 PM, Victor Subervi victorsube...@gmail.comwrote:


 I'm lost. I set up this database originally with auto_increment and the
 first value was 0. I thought that was always the case. Is there a problem
 here?


Yes, that should not have happened. For autoincrement fields, both NULL and
0 are magic values to get the next number from the sequence at insert
time.


Re: UPDATE doesn't work

2003-06-06 Thread Keith C. Ivey
On 6 Jun 2003 at 19:00, PaT! wrote:

 mysql UPDATE ordini SET prezzo = prezzo/1.024, totale = totale/1.024
 WHERE numordine1385 AND dataord'2003-06-01'; Query OK, 1649 rows
 affected (0.10 sec) Rows matched: 1650  Changed: 1649  Warnings: 0
 
 These are the values after the UPDATE
 
 mysql SELECT prezzo, totale FROM ordini WHERE numordine=1157;
 +++
 | prezzo | totale |
 +++
 |  6.795 |  6.795 |
 | 13.835 | 13.835 |
 | 17.578 | 17.578 |
 | 62.500 | 62.500 |
 +++
 4 rows in set (0.02 sec)
 
 Why the values didn't update?

Your update query has WHERE numordine  1385, but 1157 isn't 
greater than 1385.  Why would you expect the values to be updated?

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: UPDATE doesn't work

2003-06-06 Thread Roger Baklund
* PaT!
[...]
 I need to update some values in two fields 'prezzo' and 'totale' These
 are the values before the UPDATE

 mysql SELECT prezzo, totale FROM ordini WHERE numordine=1157;
 +++
 | prezzo | totale |
 +++
 |  6.795 |  6.795 |
 | 13.835 | 13.835 |
 | 17.578 | 17.578 |
 | 62.500 | 62.500 |
 +++
 4 rows in set (0.02 sec)

 this is the UPDATE query

 mysql UPDATE ordini SET prezzo = prezzo/1.024, totale = totale/1.024
 WHERE numordine1385 AND dataord'2003-06-01';
 ^
This statement only updates rows with numordine1385, your test records have
numordine=1157, which is smaller than 1385... :)

--
Roger


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: UPDATE doesn't work

2003-06-06 Thread Mikhail Entaltsev
Hi

 mysql SELECT prezzo, totale FROM ordini WHERE numordine=1157;

 mysql UPDATE ordini SET prezzo = prezzo/1.024, totale = totale/1.024
 WHERE numordine1385 AND dataord'2003-06-01';

You are selecting data for numordine = 1157, but are updating all records
that have
numordine  1385. 1157  1385. So you are not updating these records.

Best regards, Mikhail.


- Original Message -
From: PaT! [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 06, 2003 19:00
Subject: UPDATE doesn't work


 Hi
 I'm running MySQL 4.0.13
 MS Windows XP Prof

 I've this problem:
 A db with a table called 'ordini'

 mysql desc ordini;
 +-+---+--+-++---
 -+
 | Field   | Type  | Null | Key | Default| Extra
 |
 +-+---+--+-++---
 -+
 | id  | int(11)   |  | PRI | NULL   | auto_increment
 |
 | numordine   | int(10)   |  | | 0  |
 |
 | descrizione | varchar(150)  |  | ||
 |
 | marca   | varchar(250)  |  | ||
 |
 | modello | varchar(250)  |  | ||
 |
 | generica| varchar(250)  |  | ||
 |
 | quantita| int(10)   |  | | 0  |
 |
 | prezzo  | decimal(10,3) |  | | 0.000  |
 |
 | type| varchar(10)   |  | ||
 |
 | dataord | date  |  | | -00-00 |
 |
 | nominativo  | varchar(200)  |  | ||
 |
 | totale  | decimal(10,3) |  | | 0.000  |
 |
 | fromprev| int(11)   | YES  | | NULL   |
 |
 | ptype   | varchar(20)   | YES  | | NULL   |
 |
 | idutente| int(11)   | YES  | | NULL   |
 |
 | codcliente  | varchar(8)| YES  | | NULL   |
 |
 | datamod | date  | YES  | | NULL   |
 |
 +-+---+--+-++---
 -+
 17 rows in set (0.00 sec)

 I need to update some values in two fields 'prezzo' and 'totale' These
 are the values before the UPDATE

 mysql SELECT prezzo, totale FROM ordini WHERE numordine=1157;
 +++
 | prezzo | totale |
 +++
 |  6.795 |  6.795 |
 | 13.835 | 13.835 |
 | 17.578 | 17.578 |
 | 62.500 | 62.500 |
 +++
 4 rows in set (0.02 sec)

 this is the UPDATE query

 mysql UPDATE ordini SET prezzo = prezzo/1.024, totale = totale/1.024
 WHERE numordine1385 AND dataord'2003-06-01';
 Query OK, 1649 rows affected (0.10 sec)
 Rows matched: 1650  Changed: 1649  Warnings: 0

 These are the values after the UPDATE

 mysql SELECT prezzo, totale FROM ordini WHERE numordine=1157;
 +++
 | prezzo | totale |
 +++
 |  6.795 |  6.795 |
 | 13.835 | 13.835 |
 | 17.578 | 17.578 |
 | 62.500 | 62.500 |
 +++
 4 rows in set (0.02 sec)

 Why the values didn't update?
 The same query applied on a single row works perfectly.

 Any help is appreciated

 PaT!





 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]