strange behaviour with float
May 8, 2012
I have a structure like this inside my db
CREATE TABLE price (
id INT NOT NULL,
currency_id INT NOT NULL,
label VARCHAR(45) NOT NULL,
value FLOAT NOT NULL,
PRIMARY KEY(id)
);
and a stored procedure having this signature:
public class PriceAdd extends VoltProcedure {
.....
public long run(int currencyId, String label, float value) throws VoltAbortException {
.....
}
}
When I try to invoke this stored procedure (also using web interface):
exec PriceAdd 0, 'label', 12.1;
I receive this response:
Error: VOLTDB ERROR: PROCEDURE PriceAdd TYPE ERROR FOR PARAMETER 2: tryToMakeCompatible: Unable to match parameters or out of range for taget param: float to provided java.lang.String
(I have also tried without commas, wrapping the float value between ticks and some other tries).
How can be such a stored procedure called ?
CREATE TABLE price (
id INT NOT NULL,
currency_id INT NOT NULL,
label VARCHAR(45) NOT NULL,
value FLOAT NOT NULL,
PRIMARY KEY(id)
);
and a stored procedure having this signature:
public class PriceAdd extends VoltProcedure {
.....
public long run(int currencyId, String label, float value) throws VoltAbortException {
.....
}
}
When I try to invoke this stored procedure (also using web interface):
exec PriceAdd 0, 'label', 12.1;
I receive this response:
Error: VOLTDB ERROR: PROCEDURE PriceAdd TYPE ERROR FOR PARAMETER 2: tryToMakeCompatible: Unable to match parameters or out of range for taget param: float to provided java.lang.String
(I have also tried without commas, wrapping the float value between ticks and some other tries).
How can be such a stored procedure called ?