When his personal appearance is necessary, if he be in custody, the court may direct the officer in whose custody he is to bring him R.L.1910, § 5762.