Here is what it gave me when I did describe:
+-------+------------------+------+-----+---------+----------------+
| Field | Type             | Null | Key | Default | Extra          |
+-------+------------------+------+-----+---------+----------------+
| id    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| name  | char(40)         | YES  |     | NULL    |                |
| posX  | double(10,1)     | YES  |     | NULL    |                |
| posY  | double(10,1)     | YES  |     | NULL    |                |
| posZ  | double(10,1)     | YES  |     | NULL    |                |
| rotX  | int(10)          | YES  |     | NULL    |                |
| rotY  | int(10)          | YES  |     | NULL    |                |
| rotZ  | int(10)          | YES  |     | NULL    |                |
+-------+------------------+------+-----+---------+----------------+
8 rows in set (0.00 sec)

Here is the update statement that works correctly:
"UPDATE track_char SET rotX = " + Double.parseDouble(fields[i + 1]) + ",
rotY = " + Double.parseDouble(fields[i + 2]) + ", rotZ = " +
Double.parseDouble(fields[i + 3]) + "WHERE name = 'Tom'"

where 'fields' is a string array of tokens that I have parsed from a
message.

I tried doing this:
"UPDATE track_char SET rotX = " + Integer.parseInt(fields[i + 1]) + ",
rotY = " + Int.parseInt(fields[i + 2]) + ", rotZ = " +
Int.parseInt(fields[i + 3]) + "WHERE name = 'Tom'"

but that wouldn't work. And yes, I have made sure that it isn't a
problem with the parseInt() method by using hard-coded values...only
hard-coded doubles work, hard-coded ints wouldn't.

-----Original Message-----
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 06, 2006 2:09 PM
To: Thomas Amundsen; mysql@lists.mysql.com
Subject: RE: INT wants a float/double?

[snip]
Right...the thing is that they are supposed to be INTs, but I can only
successfully perform an update query if I use doubles for the fields...?
[/snip]



Do a describe on the table and make sure that they are INTs, then show
us the update statement.





"because it is hard to read"
"why?"
"top posting is bad"


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

Reply via email to