how can i use this block
This block is a procedure… Please show us the procedure you have created
And the question is …? You could modify the procedure provided in the above example according to your needs