Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of range value adjusted, problem with DECIMAL data type 1

Status
Not open for further replies.

derrickorama

Programmer
Jun 30, 2006
25
US
I don't know whether I'm doing something wrong or what, but I am trying to make a procedure that updates a table by searching for several criteria. Problem is that it won't accept the value I give for a DECIMAL data type. Here's the procedure:

DELIMITER $$

DROP PROCEDURE IF EXISTS `databaseName`.`updTable` $$
CREATE PROCEDURE `updTable`(IN c1 INT,IN c2 INT,IN c3 DECIMAL(3,2),IN c4 DATETIME,IN c5 INT,IN c6 INT)
BEGIN
UPDATE tableName SET Column1 = c1 WHERE Column2 = c2 AND Column3 = c3 AND Column4 = c4 AND Column5 = c5 AND Column6 = c6;
END $$

DELIMITER ;

-------------
Here is the call:

CALL updTable(2,1,37.50,20060630,0,0);

What I'm having a problem with is the 37.50 that I enter for c3 the DECIMAL(3,2). When I execute the call, it says:

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

It will work if I adjust the c3 to be DECIMAL(3) or something, but then it cuts off the decimals and makes 37.50 into 38. I'm also sure that the data types match up perfectly with the data types in the table that I'm updating. Is there something wrong with my syntax???
 
My understanding of Decimal(3,2) is 3 total digits with 2 decimal places, therefore maximim value would be 9.99. Check out
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Wow... Ugh! And to think of how much this irritated me. It almost irritates me more that it was something that simple. Thank you very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top