"Out of Range value" error on UPDATE
Posted by: Vincent Traag
Date: October 20, 2006 11:41AM

Hi,

I get the following error on an UPDATE command:

"Out of range value adjusted for column 'fldInteger' at row 1"

The MySQL Server is mysql-5.0.22-community-nt. The UPDATE command is issued from an C# environment using an OdbcConnection. The objUpdateCommand.CommandText reads:

"UPDATE test SET fldString = '?', fldInteger = ? WHERE fldTestId = ?"

with DbParameters set to fldString = "test", fldInteger = 2 and fldTestId = 4.

I execute the command by using objUpdateCommand.ExecuteNonQuery(); I update the table in this manner, since I need to use a general DbConnection, instead of an explicit OdbcConnection or MySQLConnection.

If if execute the same query from the Query Browser, I do not receive any error or whatsoever.

Even stranger: I tried (suggested somewhere else) to use UPDATE IGNORE ... with the same values as above. Instead of updating the correct row (where fldTestId = 4), it updates the row where fldTestId = 2, and set the values of fldString and fldInteger to "? and 0 respectively. This suggest perhaps that the error is in the C# DbCommand environment, and not in MySQL, but I am not sure.

Currently I have avoided the error by using OdbcDataAdapter and CommandBuilder, but this is not the preferred solution.

Has anyone experienced this before? Or have a usefull suggestion?

Regards,

Vincent

Options: ReplyQuote


Subject
Written By
Posted
"Out of Range value" error on UPDATE
October 20, 2006 11:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.