derrickorama
Programmer
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???
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???