If, upon the hearing of such action or proceeding in which such perjury has probably been committed, any papers or documents produced by either party shall be deemed necessary to be used on the prosecution for such perjury, the court may by order detain such papers or documents from the party producing them, and direct them to be delivered to the district attorney.
Okla. Stat. tit. 21, § 503