Any person interested may contest the demand of the plaintiff on the return day of the writ, if returned, or on any day before the rendition of final judgment in the case, by filing a statement in writing, under oath, of his defense or claim, itemizing his account, if any he has; and the case shall be then at issue between the parties, and shall be tried as other cases in the court. And the judgment of the court shall be framed so as to adjust the rights of the several parties as to the subject-matter of the suit; and judgment may be given against the party liable thereto for any amount, and for the sale of any goods in the hands of the officer, and for any balance not obtained from the sale of the goods, to be made by execution as in other cases, and the costs may be adjudged as the court may consider just; and as many judgments shall be rendered as may be necessary to adjust the rights of the several parties.