Anybody knows how to convert a big int to int in a MySQL stored procedure.
- Solution in this posthttp://stackoverflow.com/questions/11595217/convert-bigint-unsigned-to-int is not working as I tried:
set @x=BigToInt(2147483649); ERROR 1264 (22003): Out of range value for column
I tried this and it doesn't work either:
DELIMITER // DROP FUNCTION IF EXISTS BigToInt;
CREATE FUNCTION BigToInt (n BIGINT) RETURNS INTEGER begin DECLARE result INTEGER default 0; set result = CAST(n as SIGNED); return result; end// DELIMITER ;
it gives me same error as #1.