BubikolRamios
01-18-2008, 10:45 PM
all my stored procedures are working fine, but functions: example
CallableStatement cs;
java.sql.Connection con = getConnection();
// at this point error popps up
cs = con.prepareCall("{? = call " + functionName + "(?,?,?,?,?)}");
"java.lang.NumberFormatException: For input string: "1)
... stuf that is the copy of stored function
MYSQL function, which direct in mysql query analyzer works just fine:
DELIMITER $$
DROP FUNCTION IF EXISTS `test`.`addMember` $$
CREATE FUNCTION `addMember`(c_nick VARCHAR(15),
c_pwd VARCHAR(40),
c_email VARCHAR(100),
c_unique_id VARCHAR(40),
c_ip_value long
) RETURNS varchar(1)
BEGIN
DECLARE countryCode2 INT;
#duplicate entry#
DECLARE EXIT HANDLER FOR 1062 return '-1';
#za vse ostale nepredvidene fore#
DECLARE EXIT HANDLER FOR SQLEXCEPTION return '-2';
select cc2 into countryCode2 from Imported_data_ipToCountry where ip_from < c_ip_value and ip_to > c_ip_value ;
INSERT INTO MEMBER (nick,pwd,email,ip_to_country,reg_unique_id,osp,dsp)
values(c_nick,c_pwd,c_email,countryCode2,c_unique_id,user(),now());
return '0';
END $$
DELIMITER ;
had originaly; RETURNS int(11), but result was the same.
thanks for any help.
CallableStatement cs;
java.sql.Connection con = getConnection();
// at this point error popps up
cs = con.prepareCall("{? = call " + functionName + "(?,?,?,?,?)}");
"java.lang.NumberFormatException: For input string: "1)
... stuf that is the copy of stored function
MYSQL function, which direct in mysql query analyzer works just fine:
DELIMITER $$
DROP FUNCTION IF EXISTS `test`.`addMember` $$
CREATE FUNCTION `addMember`(c_nick VARCHAR(15),
c_pwd VARCHAR(40),
c_email VARCHAR(100),
c_unique_id VARCHAR(40),
c_ip_value long
) RETURNS varchar(1)
BEGIN
DECLARE countryCode2 INT;
#duplicate entry#
DECLARE EXIT HANDLER FOR 1062 return '-1';
#za vse ostale nepredvidene fore#
DECLARE EXIT HANDLER FOR SQLEXCEPTION return '-2';
select cc2 into countryCode2 from Imported_data_ipToCountry where ip_from < c_ip_value and ip_to > c_ip_value ;
INSERT INTO MEMBER (nick,pwd,email,ip_to_country,reg_unique_id,osp,dsp)
values(c_nick,c_pwd,c_email,countryCode2,c_unique_id,user(),now());
return '0';
END $$
DELIMITER ;
had originaly; RETURNS int(11), but result was the same.
thanks for any help.