your company will ask you for a bank clearance before they cancel your RP and give you your exit permit, so you will have to pay that loan before moving to dubai