When two or more persons are included in the same indictment or information, the court may, at any time before the defendants have gone into their defense, on the application of the district attorney, direct any defendant to be discharged from the indictment or information, that he may be compelled to be a witness for the state.
Okla. Stat. tit. 22, § 839