
784 S.W.2d 421 (1990)
STATE of Texas ex rel. John B. HOLMES, Jr., Applicant,
v.
The Honorable Lupe SALINAS, Judge, 351st District Court of Harris County.
No. 70954.
Court of Criminal Appeals of Texas, En Banc.
February 14, 1990.
John B. Holmes, Jr., Dist. Atty., Calvin A. Hartmann, Asst. Dist. Atty., Houston, for applicant.
Ted Doebbler, Stanley G. Schneider, W. Troy McKinney, Thomas D. Moran, Robert Huttash, Houston, for respondent.
Before the court en banc.

OPINION
W.C. DAVIS, Judge.
This is an original application for writ of mandamus by which the District Attorney of Harris County, as relator, seeks to have an order entered by respondent trial judge *422 set aside. TEX.CONST. art. V, Sec. 5; Art. 4.04, V.A.C.C.P.
Relator alleges respondent exceeded his authority as a magistrate by entering orders relating to two pending prosecutions directing the district attorney not to present either case to a grand jury prior to completion of an examining trial ordered by respondent in each pending case. Relator contends and respondent concedes the State has no adequate remedy at law. Relator requests that this Court issue a writ of mandamus directing respondent to vacate his orders in Cause Numbers 527,238 and 526,361 in the 351st District Court of Harris County.
On April 5, 1989, a suspect was arrested for the offense of possession of a controlled substance. The case was directly filed in respondent's court. On May 5, 1989, respondent granted a defense motion for an examining trial and ordered the district attorney not to seek an indictment in the case.
On March 27, 1989, a defendant was arrested on a possession charge. On May 15, 1989, respondent granted the defense motion for an examining trial and again further ordered the State not to present the case before the grand jury until an examining trial had been held.
The State sought mandamus relief from the Court of Appeals for the Fourteenth Judicial District. The appeals court denied relief, construing Section 22.221(b) of the Government Code as requiring district and county judges to be functioning in that capacity, rather than as magistrates, in order for their actions to be subject to writs of mandamus by the courts of appeal. See TEX.GOV'T CODE Ann. § 22.221(b). Holding it lacked jurisdiction precisely because respondent was functioning in the capacity of magistrate rather than as district judge when the orders restraining the district attorney were made, the appeals court decided that relator's application had been improvidently granted. The orders by the court granting leave to file and granting a stay were therefore withdrawn and the petition for leave to file was denied. Rehearing was denied on August 17, 1989.
Thereafter relator filed his motion for leave to file this original application for writ of mandamus. On August 28, 1989, this Court entered an order directing Judge Salinas to respond to the allegations contained within the instant motion for leave to file. All proceedings were stayed. Judge Salinas' response has now been filed with the Court and may be summarized as follows:
(A) This Court has no jurisdiction over the instant matter because relator has not "sued" respondent in his proper capacity. While Judge Salinas is being sued in his capacity as district judge, he was not acting as a judge but as a magistrate at the time he issued the orders in question. Mandamus relief should be sought against relator, if at all, in his proper capacity. Since Judge Salinas lacks jurisdiction over the underlying causes until indictments are returned, he lacks the judicial authority to withdraw the order being challenged and cannot comply with an order from this Court. Therefore this Court lacks jurisdiction and relief should be denied.
(B) Relator's entire argument is based upon the mistaken premise that respondent exceeded his limited jurisdiction and authority as a magistrate sitting in an examining court. The Code of Criminal Procedure vests magistrates with specific authority, jurisdiction, duties and responsibilities, including a sole and exclusive jurisdiction and authority to conduct and preside at examining trials pursuant to Article 16.01, V.A.C.C.P. The relevant question is therefore whether Judge Salinas is presiding at an examining trial in the 351st District Court or in some other court. Clearly for purposes of an examining trial, respondent is presiding over an examining court and under TEX. GOV'T CODE Ann. § 21.001, has the authority and powers of a "court" for the exercise of its jurisdiction and enforcement of its lawful orders, including "authority to issue the writs and orders necessary or proper in aid of its jurisdiction." Id. Since any court has the power *423 to prevent a party from taking any action that destroys or substantially impairs the res of impending litigation within the jurisdiction of the court, Judge Salinas, as magistrate of the examining court, has the power to enforce his order restraining the State from bringing the two underlying cases to the grand jury pending an examining trial in both cases.
(C) Relator's rights have not been impinged by respondent's orders. First, respondent's orders do not affect the independent grand jury's rights. Distinguished from federal practice, state law provides that a grand jury is an independent body with independent authority that may proceed independently of the prosecutor, who is reduced to a "mere scrivener." Article 20.03, V.A.C.C.P. does not impose a mandatory duty on the district attorney to present cases to the grand jury, but rather permits relator the discretionary power to appear before the grand jury and inform them of offenses liable to indictment. Second, relator's position that the right to an examining trial is not absolute is severely flawed in several respects. Judge Salinas never attempted to order the grand jury not to inquire into any offense on its own. Relator has no statutory right or duty to "inquire into the offense" in the same fashion as does the grand jury, and respondent has in no fashion attempted to restrain relator from inquiring into the offense for his own purposes.
This Court has jurisdiction to issue writs of mandamus pursuant to Article V, § 5 of the Texas Constitution. In order for mandamus to issue, the party seeking mandamus must show that there is no other adequate remedy available and that the act sought to be compelled is a ministerial act. Stearnes v. Clinton, 780 S.W.2d 216 (Tex. Cr.App.1989). Mandamus is not available to compel a discretionary act as distinguished from a ministerial act. State ex rel. Holmes v. Denson, 671 S.W.2d 896 (Tex.Cr.App.1984); Ordunez v. Bean, 579 S.W.2d 911 (Tex.Cr.App.1979). Mandamus will issue where there is but one proper order. State ex rel. Curry v. Gray, 726 S.W.2d 125 (Tex.Cr.App.1987); State ex rel. Vance v. Routt, 571 S.W.2d 903 (Tex. Cr.App.1978). Mandamus may also issue if a judge acts beyond his statutory authority. Denson, supra; White v. Reiter, 640 S.W.2d 586 (Tex.Cr.App.1982). If a district judge enters an order for which he has no statutory authority, mandamus will issue. Gray, supra; Denson, supra; Wilson v. Harris, 555 S.W.2d 470 (Tex.Cr.App.1977).
Relative to the first question whether the act is ministerial rather than judicial or discretionary in nature, the focus is upon "whether the respondent had the authority" to do what is the subject of the complaint. Clinton, supra, quoting State ex rel. Thomas v. Banner, 724 S.W.2d 81 (Tex.Cr.App.1987). In Clinton, supra, the district judge issued an order removing appointed counsel from the underlying case. A unanimous Court held the trial court was without authority to order said counsel removed under the circumstances of the case, and conditionally granted relief. In Thomas, supra, a district judge granted a defendant shock probation on four convictions. The district attorney sought mandamus relief, contesting the trial court's statutory authority to so act. Finding there was no statute authorizing the trial court to grant shock probation in such cases, and further finding the State had no other adequate remedy at law, relief was conditionally granted. See also State ex rel. Vance v. Hatten, 600 S.W.2d 828 (Tex.Cr.App.1980) (trial judge lacked authority to grant shock probation to defendant convicted of involuntary manslaughter since offense was one of excepted enumerated offenses).
The instant case presents a scenario differing from the above cited cases in that respondent is being sued in his limited capacity as magistrate rather than his general capacity as trial court judge of a district court. Two intertwined arguments are raised in response to the application. First, relator has not brought a proper suit since the activity sought to be restricted arises from a magistrate's order and not the order of a trial court. Second, a magistrate, presiding over a separate "examining court", is imbued with all authority inherent in other judicial courts, including the *424 power to issue any and all orders protecting the jurisdiction of the examining court, with the result that the magistrate is authorized to restrain the district attorney from proceeding, in his official capacity, to bring such evidence as he may have regarding the two alleged underlying offenses in question before the grand jury for the purpose of seeking an indictment in either case. Thus, we are first asked to determine whether the proper parties have been joined, and next to determine, if necessary, the appropriateness of a mandamus action against a magistrate who has entered an order effectively preventing the district attorney from seeking an indictment.
It is agreed that respondent properly presides over the 351st District Court of Harris County. As is the custom with the judges in the county, Judge Salinas sits as a magistrate prior to the return of an indictment. This role is provided Judge Salinas solely through his office of district judge. See Art. 2.09, V.A.C.C.P. Thus, respondent's authority to act in the capacity of magistrate is dependent upon his office. We see no problem or jurisdictional defect by nature of the pleadings naming respondent in the capacity of that office which is the foundation for his other, more limited activities as magistrate in this criminal law matter. TEX.CONST. art. V, Sec. 5; Art. 4.04, V.A.C.C.P. We will therefore turn our attention to the merits of the case.
The duties and authority attendant to the role of magistrate "within the meaning of" the Code of Criminal Procedure are clearly set out in Arts. 2.10 and 2.11, V.A.C.C.P. A magistrate is provided the authority to hold an examining trial by virtue of Art. 16.01, V.A.C.C.P. "When the accused has been brought before a magistrate for an examining trial," that officer is directed to "proceed to examine into the truth of the accusation made" against the suspect. Id. (emphasis supplied)
The traditional and statutory purposes of an examining trial are (1) to determine whether there exists sufficient evidence of guilt to hold a suspect accused of criminal conduct; (2) to determine whether bail should be allowed and if so, the amount of bail; and (3) to perpetuate the testimony of witnesses, including any voluntary statement the suspect may wish to make. Harris v. State, 457 S.W.2d 903 (Tex.Cr.App. 1970); see Art. 16.01 et seq. Although a suspect's right to an examining trial is termed "absolute", it is very well settled that this right to a preliminary hearing is not unrestricted but is in fact terminated by the return of an indictment. Brown v. State, 475 S.W.2d 938 (Tex.Cr.App.1972); Harris, supra, and cases there cited.
In Harris, supra, this Court discussed the relationship between an examining trial or hearing and the return of an indictment by a legally constituted grand jury, in terms of the rights afforded to a criminal suspect:
Though the preliminary hearing provided for in Article 16.01 V.A.C.C.P., may be a practical tool for discovery by the defendant, the primary justification for its existence is to protect the innocent defendant from incarceration on a totally baseless accusation. Therefore, before the accused may be held for grand jury action, our statutes require the prosecution to justify his incarceration by proving in an examining trial before a magistrate that there is probable cause to believe the accused committed the offense charged. Article 16.17, V.A.C.C.P. See also Barrett v. United States, 270 F.2d 772, 775 (8th Cir.1959). If the grand jury returns a true bill prior to the time that an examining trial is held, the principal purpose and justification of such hearing has been satisfied. See Vincent v. United States, 337 F.2d 891 (8th Cir.), cert den., 380 U.S. 988, 85 S.Ct. 1363, 14 L.Ed.2d 281. Action by a grand jury in returning the indictment supersedes the complaint procedure and eliminates the necessity of an examining trial. Jaben v. United States, 381 U.S. 214, 85 S.Ct. 1365, 14 L.Ed.2d 345; State v. Wigglesworth, 18 Ohio St.2d 171, 248 N.E.2d 607.
Harris v. State, 457 S.W.2d at 907.
The Harris case is instructive in explaining the relationship between an accused *425 and an examining trial. Such a hearing is for the purpose of protecting the innocent from protracted baseless incarceration by providing a forum for determination whether probable cause exists to bind the individual over for further action by the State. While incidentally being a "practical tool for discovery" by the defense, the inherent justification for the hearing is to put the State to its burden of proving that probable cause exists to believe the accused committed the offense charged against him. Thus, the reason or justification for the hearing ceases at the time the grand jury returns its own probable cause determination via the indictment. This is true even in the case where the hearing is pending or is due to resume at a later date. See Brown, supra. It would appear logical and proper, then, that any power or authority vested in a magistrate by reason of his statutory responsibilities is also limited within the parameters of an arrest and the return of an indictment. Within these limits, we may agree with respondent that an examining court's authority, as codified under § 21 of the Government Code, encompasses all that is necessary for the exercise of the court's jurisdiction and enforcement of its orders.
Seemingly overlooked by respondent, however, is the limiting nature of the Government Code provision upon which he relies. Section 21.001 states as follows:
(a) A court has all the powers necessary for the exercise of its jurisdiction and the enforcement of its lawful orders, including authority to issue the writs and orders necessary or proper in aid of its jurisdiction.
(b) A court shall require that proceedings be conducted with dignity and in an orderly and expeditious manner and control the proceedings so that justice is done. (emphasis supplied)
In terms of an examining court, given the primary purpose for such a hearing, it is reasonable to include within such authority the power to require the State to carry forward its burden of proof without unnecessary delay in such a manner that a determination on probable cause may be made by the court as based upon the evidence. In the instant cause, however, respondent's actions restraining relator from seeking an indictment in the two underlying cases would appear to promote a conflict between the inherent power of a court qua court and the statutorily limited jurisdiction of an examining court which expires upon the return of an indictment. Respondent argues that Denson, supra, and Taylor v. State, 670 S.W.2d 365 (Tex.App.Tyler 1984, no pet.), provide no authority for the relator's position. Specifically, while in Denson, supra, the trial court exceeded its authority by ordering the State not to refile certain dismissed cases because the dismissal order effectively terminated the court's jurisdiction, respondent argues that he has neither dismissed the two cases nor taken any other action which would terminate his jurisdiction. Instead, the order complained of is in fact limited to respondent's present and pending jurisdiction to conduct an examining trial.
Moreover, it is asserted that in Taylor, supra, the trial court's order appointing a special prosecutor ignored statutory prerequisites for issuing the order, while in the instant case there is no statute setting terms under which respondent's orders could be issued. If respondent had permanently enjoined relator from presenting the cases to a grand jury or ordered the defendants discharged and then attempted to restrain the state from seeking an indictment, an entirely different issue would be presented.
Although Denson and Taylor, both supra, are factually distinguishable from the case at bar, the underlying thread binding the causes is that a particular order of a court was challenged as extrajudicial; the former cases holding the acts to be outside the court's authority. It may also be noted that, as in Taylor, supra, a question is raised in the instant cause as to the "inherent" authority of any court provided by statute. To this end, it is instructive to recognize that § 21.001, supra, while prescribing the authority of a court, also limits or conditions that authority. As noted above, a court is provided all powers necessary for exercise of its jurisdiction and for *426 enforcement of its lawful orders. It therefore follows that a court of limited jurisdiction, such as an examining court, is not provided with greater authority than necessary to fulfill its statutory role.
The Code of Criminal Procedure spells out the duties and responsibilities of the magistrate and the matters to be raised at an examining trial. See, e.g., Arts. 2.09 2.11; 15.17, and 16.01, V.A.C.C.P. There is no provision requiring or even allowing a magistrate to restrict the process by which a legally constituted grand jury considers cases presented for its consideration. By the very nature of the process for which it is employed, an examining court is supposed to function with a limited juridic goal: determination whether there exists probable cause to further restrain the accused. Return of an indictment forecloses any other determination and satisfies the conditions upon which the examining court depends for its jurisdiction. To attempt to restrain the prosecution, even in the short term pending conclusion of the hearing, thwarts the very process by which an accused is assured a speedy resolution of the question whether he shall be bound over to face formal charges.
Yet another problem exists with respondent's action in restraint of the district attorney. Relator contends the orders at issue interfere with the district attorney's statutory and constitutional authority to advise and present matters to a grand jury, as well as the authority of the grand jury to decide the matters subject to the orders entered by respondent. Respondent, in turn, describes relator's claims as the "proverbial strawman." He asserts relator has no "power or right" to present cases to the grand jury, and states that his orders in no way compromise the grand jury's authority to inquire into the matter on its own. Respondent then makes the argument that the state and federal processes are different, in that a federal prosecutor must sign the indictment in order for it to be a valid instrument, while in the state system, it is the grand jury foreperson who provides formal recognition of the grand jury's determination, reducing the district attorney to a "mere scrivener."
Article V, § 21 of the Texas Constitution provides for the election of district attorneys and specifically states that the duties of the office shall be regulated by the Legislature. See TEX.CONST. art. V, § 21. The Legislature has in turn enacted several provisions in the Code of Criminal Procedure dealing with the office of district attorney and its interaction with the grand jury process. "Each district attorney shall represent the State in all criminal cases in the district courts of his district ..." Art. 2.01, V.A.C.C.P. "The attorney representing the State, is entitled to go before the grand jury and inform them of offenses liable to indictment at any time except when they are discussing the propriety of finding an indictment or voting upon the same." Art. 20.03, V.A.C.C.P. (emphasis added) Although it is the grand jury and not the district attorney who is ultimately responsible for the return of a "true bill" or a "no-bill" in a case, the Code clearly envisions that both entities will work together to resolve the particular matters at issue, either in instances where some member of the panel may have knowledge of an offense liable for indictment, or "of which they shall be informed by the attorney representing the State...." Art. 20.09, V.A. C.C.P. Contrary to respondent's assertions, it is apparent that a district attorney has not only been given the authority but also assigned the responsibility by the Legislature to bring matters "liable to indictment" to the attention of the grand jury. This responsibility does not begin after an examining trial; the district attorney is charged with informing the grand jury of alleged offenses "at any time" other than the time the panel is engaged in discussion or deliberation. Moreover, the statute speaks in terms of the district attorney's right to seek an indictment at any such time: "The attorney representing the State, is entitled[1] to go before the grand jury and inform them of offenses liable to *427 indictment at any time except when they are discussing the propriety of finding an indictment or voting upon the same." Art. 20.03, supra.
Respondent would also have this Court adjudge a district attorney's powers and duties before a grand jury to be subservient to an accused's "absolute right" to an examining trial. Citing TEX.GOV'T Code, § 311.025(b), we are informed that the statutes at issue are "potentially conflicting" and thus the rules of statutory construction require that the provisions be interpreted in harmony so that effect may be given to each. According to respondent such harmonizing requires that the State's entitlement to seek an indictment must yield to the accused's right to an examining trial. We do not agree. It has long been the law in this state, as discussed ante, that the return of an indictment terminates any right to an examining trial. Ex parte Clear, 573 S.W.2d 224 (Tex.Cr.App.1978); Harris, supra, and cases therein cited. This has been held true even where an examining trial was pending, such as in the instant case. Brown, supra; Murphy v. State, 424 S.W.2d 231 (Tex.Cr.App.1968).
We have in the past held that the court in which a felony complaint is filed has sole and exclusive jurisdiction of the matter until an indictment is presented or an information is filed on the waiver of an indictment. Clear, supra. The caselaw speaks in terms of a bright-line process in which, for our purposes, an examining court has sole and exclusive jurisdiction over the case but loses that jurisdiction upon presentment of the indictment. Again, it is entirely consistent with the underlying purpose of an examining trial for such a line to be drawn. Harmonizing the particular statutes in question, although in a manner different than respondent would urge, illustrates a logical order to the post arrest process. The accused is afforded the absolute right to have a probable cause determination made in his case. This may be accomplished with or without an examining trial, but may never be accomplished without a grand jury either acting in a primary or secondary step in the process, except with non-capital waivers of indictment. Harris, supra, and cases therein cited. On the other hand, the district attorney's statutory duty to assist the grand jury encompasses the right to go before that body and seek an indictment at any time except during deliberations. There is no statutory provision requiring the district attorney to wait for the conclusion of an examining trial before proceeding to seek an indictment, and such a judicially created proscription would appear to adversely affect the accused's right to a speedy resolution of the matter for which he has been charged.
Whether respondent's order restrained the district attorney in a temporary or permanent fashion is of no moment. The district attorney is entitled by statute to proceed, regardless whether an examining trial is pending, to seek an indictment in a criminal matter. Respondent's orders in the two cases prevented the district attorney from pursuing his statutory obligations. While respondent may issue orders consistent with his limited authority as magistrate, he may not issue orders which improperly restrain the district attorney from the proper exercise of his duties. Because Art. 16.01, supra, clearly terminates the right to an examining trialand thus the need for the hearingat the time an indictment is presented, it would be specious for this Court to now hold that the grand jury process may be held at bay, dependent upon the conclusion of an examining trial. It has never been and is not now the law in this state that an adult accused is entitled to an examining trial before the case may be presented to a grand jury. Due process considerations are not implicated since the primary purpose for the examining trial, a determination of probable cause, is at least as timely accomplished by presenting evidence directly to the grand jury.
We therefore hold that respondent did not have the authority to issue the order restraining relator from presenting evidence of the liable offenses before the grand jury. Because he did not have the authority to issue the orders, the orders *428 are void. Stearnes, supra. As we have previously stated in the Hatten case, mandamus is the proper relief to set aside an improper order. See also Banner and Harris, both supra. We assume respondent will immediately perform his duty to withdraw such void orders. The writ of mandamus will issue only if he refuses to do so. It is so ordered.
CLINTON and DUNCAN, JJ., concur in the result.
TEAGUE, J., dissents.
NOTES
[1]  The Fifth Edition of Black's Law Dictionary defines the term "entitle" in common usage: "In its usual sense, to entitle is to give a right or legal title to."
