delimiter $$ create procedure add_record(in `in_key` int ,in `in_value` varchar(10)) begin declare isKey int; set isKey=0; select count(`key`) into iskey from tbl_name where `key`=`in_key`;
if isKey=0 then insert into tbl_name values(`in_key`,`in_value`); end if; end$$ delimiter ;