How to pass null value to mysql stored procedure using java -
below stored procedure
drop procedure `addrecord`// create definer=`root`@`localhost` procedure `addrecord`(company varchar(3000),name varchar(3000),title varchar(3000),metro varchar(3000),city varchar(3000),email varchar(3000),phone varchar(3000),industry varchar(3000)) begin insert ignore record_data (company,name,title,metro,city,email,phone,industry) values(company,name,title,metro,city,email,phone,industry); end
my main task check duplicate entries. works fine if provide values fields. if provide field null java inserts new row.rather eliminating duplicate. for e.g.
if use following statement dosent insert entry if exists record.addrecord("abc", "a", "abc", "a","b","ostwal@gmail.com", "518- 220", "intl"); if use record.addrecord("abc", "a", "abc", null,null,"ostwal@gmail.com", "518- 220", null); inserts row if exists.
Comments
Post a Comment