Running a query with parameters and conditions using macro on form.

Hi Sir!
Further to my previous question where I used a simple insert query with parameters to insert a record in a table taking values from other table. This time my query also have a condition. First it have to check weather the value IS NOT NULL then will insert record like this. This is a mysql procedure;
DELIMITER //
CREATE PROCEDURE InsertBfee(IN sid INT)
BEGIN
DECLARE bfee INT;
SELECT Bus_Fee INTO bfee FROM Fee_Def WHERE
STUDENT_ID = sid;
IF bfee IS NOT NULL THEN
INSERT INTO Fee_Trans(Fee_Type,Month,Stud_IDfk,Fee_Amount) VALUES (‘BUS’,‘May’, sid,bfee);
END IF;
END //
DELIMITER ;
This procedure working perfectly if CALL it from macro on Base. Now I am trying to use it in HQLSDB database in query.
Can you please guide me in reference to last question’s macro code. How to write query for this above procedure and what change needed in macro code.
Thank you very much.

The mysql procedure can be rewrite in following simple SQL statement;
image description

As the parameter is used once so it will be write once in macro code as it is discussed in referred question
(previous question).