CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure7`( In p1_no int(11),
In id int(10) ,
 In name  varchar(50) , 
 In surname int(10) ,
 In age int(10) ,
 in gender int(10) )
begin
If ( name1) not null then 
 INSERT INTO krishna.tbl_batperformance (id ,name ,  surname , age , gender )values(
    (SELECT id 
    FROM tbl_std
    WHERE tbl_std.stud_name = name ) ,
    name ,surname, age , gender, fibat1fours );
end if ;
end ;
This is the procedure I had written, but the problem is that I have to check all input parameters in the procedure whether they are null or not and I have to insert them into table.