
193 Or. 688 (1952)
240 P.2d 958
STATE EX REL. BETHKE
v.
BAIN, AS CIRCUIT JUDGE
Supreme Court of Oregon.
Submitted on petitioner's demurrer, on briefs, January 24, 1952.
Peremptory writ ordered February 6, 1952.
*690 Donald H. Joyce, of Portland, for petitioner.
William B. Murray and Maurice V. Engelgau, of Portland, for respondent.
PEREMPTORY WRIT ORDERED.
TOOZE, J.
This is an original proceeding in mandamus, instituted by the state of Oregon, ex rel. Carl H. Bethke, as plaintiff, against James R. Bain, as judge of the circuit court of the state of Oregon, for the county of Multnomah, as defendant, to require the defendant to quash an order discharging an attachment.
Carl H. Bethke, as plaintiff, brought an action in the circuit court of Multnomah county, Oregon, against Hollywood Liquidating Corporation, formerly Hollywood Ford Motors, Incorporated, an Oregon corporation, as defendants, to recover money. A writ of attachment was issued in that action, and the sum of $800, *691 belonging to defendant, was attached and garnisheed and taken into possession by the sheriff of Multnomah county, as shown by the return of said sheriff to the original writ of attachment. Defendant moved to discharge the attachment on the ground:
"* * * that the plaintiff's action is not based upon a contract for the direct payment of money, but is founded upon an alleged breach of contract * * *. That any claim plaintiff may have is unliquidated and uncertain."
The defendant in this proceeding sustained the motion, made an order discharging the attachment, and, at the same time, made a further order staying all proceedings until this court rules on plaintiff's petition for a peremptory writ of mandamus.
The plaintiff filed in this court his duly verified petition for an alternative writ of mandamus directed to defendant. In this petition he alleged the several facts upon which he relied and attached to the petition as an exhibit a true copy of the complaint in the action commenced by him in the trial court. This court ordered that an alternative writ issue directed to defendant commanding him to rescind, revoke, and set aside the order discharging the attachment or, in lieu thereof, show cause why he has not done so. The alternative writ was issued and duly served upon defendant.
The writ, omitting formal parts, is as follows:
"THE STATE OF OREGON TO: JAMES R. BAIN, as Judge of the Circuit Court of the State of Oregon, for the County of Multnomah, GREETING:
"WHEREAS, it manifestly appears by the Second Amended verified Petition of CARL H. BETHKE, the party beneficially interested herein, that you were the judge who caused to be made an entry dissolving a Writ of Attachment duly issued *692 by the Clerk of your Court in a cause duly filed in your court under the name and title of CARL H. BETHKE, Plaintiff, vs. HOLLYWOOD LIQUIDATING CORPORATION, formerly HOLLYWOOD FORD MOTORS INCORPORATED, an Oregon corporation, Defendant, Case 194-153 in the Circuit Court of the State of Oregon for the County of Multnomah, and
"WHEREAS, Title 7, Chapter 2, O.C.L.A. 1940, as amended by Chapter 183, Oregon Laws 1941 and Chapter 18, Oregon Laws 1943, at all times herein mentioned was and now is in full force and effect, and said statute provides the manner and causes in which Writs of Attachment may issue, and further provides the manner and causes for dissolution of any such Writs of Attachment, and
"WHEREAS, it manifestly appears on the face of the proceedings herein and the verified Second Amended Petition of Carl H. Bethke for a Writ of Mandamus that he has complied with all of the terms and conditions set forth in said statute, and was entitled to have issued the said Writ of Attachment, and to have sufficient property seized by virtue thereof, to be held pending the disposition of the said action filed in your Court, and
"WHEREAS, it appears that the Sheriff of Multnomah County, State of Oregon, after summons was issued in the manner prescribed by law, duly executed the said Writ of Attachment as issued, by delivering and serving a true and correct copy of said Writ of Attachment, together with a Notice of Garnishment, to Michele F. Salta, and that subsequently and on the 7th day of August, 1950, the said Sheriff of Multnomah County, State of Oregon, duly filed his return of service of the garnishment under the said Writ of Attachment, and certified therein that he held Eight-Hundred ($800.00) Dollars of money belonging to the said defendant corporation by virtue thereof, and
"WHEREAS, it appears that said cause has not yet been brought to a trial of the issues, and

*693 "WHEREAS, it appears that on the unverified motion of the attorney for said defendant, THE HOLLYWOOD LIQUIDATING CORPORATION, formerly HOLLYWOOD FORD MOTORS INCORPORATED, an Oregon corporation, you, as Judge of the Circuit Court of the State of Oregon for the County of Multnomah, caused to be made an entry in said case, as aforesaid, dissolving said Writ of Attachment contrary to the terms as made and provided in said statute, and
"WHEREAS, it appears that subsequent to the filing of said action, said defendant corporation caused its name to be changed to STODDARD FORD INCORPORATED, and, at the time of the filing of the petition herein, maintained no agent or attorney for service within the State of Oregon, and has failed to provide the Corporation Commissioner of the State of Oregon with a post-office address or place of business within the State of Oregon, and
"WHEREAS, it appears that the said STODDARD FORD INCORPORATED is now insolvent, and
"WHEREAS, dissolution of the said Writ of Attachment will deprive petitioner of substantial rights by way of having satisfied any judgment rendered in said action, and
"WHEREAS, it appears that the petitioner has no plain, speedy or adequate remedy in the ordinary course of the law, and petitioner has no recourse by way of an appeal from said order in said action, and
"WHEREAS, by order of this Court duly ordered and made in the above-entitled proceedings on the 26th day of October, 1951, it was ordered that a Writ of Mandamus should issue to you,
"THEREFORE, You are commanded that, immediately after the receipt of this Writ, you issue, or cause to be issued, an Order rescinding, revoking, and setting aside the said order made by you and dated the 11th day of October, 1951, wherein *694 and whereby you ordered dissolved the Writ of Attachment theretofore issued out of the Circuit Court of the State of Oregon for the County of Multnomah and discharged the property held by the Sheriff of said County by virtue of said Writ of Attachment in case No. 194-153, CARL H. BETHKE, Plaintiff, vs. HOLLYWOOD LIQUIDATING CORPORATION, formerly HOLLYWOOD FORD MOTORS INCORPORATED, an Oregon Corporation, Defendant, or that you show cause before this Court on the 6th day of November, 1951, at 10 A.M. O'Clock, why you have not done so.
"Witness the Honorable James T. Brand, Chief Justice of the Supreme Court of the State of Oregon, attested by my hand and seal of said court, this 26th day of October, 1951.
                    "[Sgd.] Arthur S. Benson
    [Seal]          Clerk of the Supreme Court
                    of the State of Oregon"
It is noted that no copy of the complaint in the original action is attached to the original writ of mandamus, nor is it pleaded in haec verba in said writ. The only place it may be found is as an exhibit attached to plaintiff's second amended petition for writ of mandamus, and based upon which the order for the writ was entered by this court. Upon the issuance of the writ, the petition therefor became functus officio. It serves no further purpose in this proceeding, nor could it serve any further purpose, unless it had become necessary to issue an amended writ.
1, 2. It is well established in this state that a petition for mandamus is no part of the pleadings. It is the writ that serves the same purpose as the complaint in other actions, and in the writ itself must be stated all the material facts; it must show on its face a clear right to the relief demanded. If any exhibit, such as a copy of *695 the complaint in the original action, is material, it must be attached to and made a part of the writ or, in lieu thereof, pleaded therein. Otherwise, it is not before the court. Crawley v. Munson, 131 Or 428, 283 P 29; State ex rel. Bell v. Pierce et al., 118 Or 533, 247 P 812; Elliott v. Oliver, 22 Or 44, 29 P 1.
The defective writ in this proceeding could have been reached by demurrer. Instead of demurring, however, the defendant filed an answer to the writ. Omitting formal parts, the answer alleges:
"Comes now the respondent, James R. Bain, as judge of the Circuit Court of the State of Oregon, for the County of Multnomah, by his attorneys William B. Murray and Maurice V. Engelgau, and for answer to the alternative writ of mandamus issued herein and returned herewith affirmatively alleges:
"That the complaint described in paragraph II of petitioners' second amended PETITION FOR WRIT OF MANDAMUS, and a copy of which was annexed thereto and marked `Appendix A', is a true and exact copy of the original complaint filed in the Circuit Court of the State of Oregon for the County of Multnomah, Carl H. Bethke, plaintiff, vs. Hollywood Liquidating Corporation, formerly Hollywood Ford Motors, Incorporated, an Oregon corporation, defendant, Case No. 194-153, and that said complaint states the facts upon which respondent made his ruling and order dissolving the writ of attachment that had been issued in said cause.
"That Section 7-201, O.C.L.A., 1940, as amended by Chapter 183, Oregon Laws 1941, provides that attachment will lie only in an action upon a contract expressed or implied for the direct payment of money, when the defendant is a resident of the State of Oregon.
"That Section 7-218, O.C.L.A. 1940, provides that the defendant may apply by way of motion to *696 the court wherefrom a writ of attachment has issued, to discharge the attachment.
"That the defendant in said cause filed June 9, 1950, in the Circuit Court of the State of Oregon for Multnomah County, moved the court to discharge the attachment issued in said action on June 9, 1950, on the grounds that the action of plaintiff Carl H. Bethke was not an action on a contract for the direct payment of money, not for a liquidated and certain claim.
"That on October 4, 1951, the matter came on for hearing before the defendant; that the plaintiff in said cause appeared by his attorney, Donald H. Joyce, and defendant in said cause appeared by its attorneys William B. Murray and Maurice V. Engelgau; that the defendant, after hearing argument of counsel and being otherwise advised in the premises ordered the attachment dissolved.
"That the defendant duly and regularly sitting in the capacity of presiding Judge of said Court had jurisdiction to rule on said motion.
"That as a matter of law respondent ruled that the statutory grounds for attachment as set out in Sec. 7-201, O.C.L.A., 1940, as amended by Chapter 183 Oregon Laws 1941, were not present in the action instituted by the plaintiff in said cause, and did not appear on the face of the proceedings, and respondent therefore ordered that said attachment be dissolved and held for naught.
"That said ruling and order by the defendant was within the recognized discretion of the defendant, and that there was no abuse of discretion in making said ruling and order.
"That plaintiff has recourse by way of an appeal from said order in said action after judgment is rendered in said cause.
"That said ruling does not deprive plaintiff of any right that he might have by virtue of said cause of action.
"WHEREFORE, the defendant prays that the *697 said alternative writ be discharged; that he be dismissed, and that he recover his costs herein expended."
To this answer, plaintiff has filed a demurrer "on the grounds and for the reason that the facts set forth in said answer herein are not sufficient to constitute a defense to said Alternative Writ of Mandamus."
3. It will be observed that, in the first paragraph of defendant's answer, reference is made to the true copy of the complaint in the original action that is attached to and made a part of plaintiff's second amended petition for writ of mandamus, and the entire answer is based upon the assumption that this complaint is before the court. We think this reference to the complaint in defendant's answer has the effect of incorporating it therein and making it a part of the answer by reference, and that we are entitled to refer to the exhibit mentioned in determining the issues. The petition, though functus officio, is, nevertheless, actually on file in this court and proceeding and, therefore, available for our inspection by virtue of defendant's invitation. It is our opinion that this reference to the complaint in the answer of defendant cures the defect in the original writ to which attention has heretofore been directed.
The complaint in the original action, omitting formal parts, is as follows:
"I
"That at all times herein mentioned HOLLYWOOD LIQUIDATING CORPORATION was and now is a corporation organized and existing under and by virtue of the laws of the State of Oregon, but that at all times herein mentioned said HOLLYWOOD LIQUIDATING CORPORATION was known as and was doing business under the name *698 and style of HOLLYWOOD FORD MOTORS INCORPORATED, at 2500 Northeast Sandy Boulevard, in the City of Portland, County of Multnomah, State of Oregon;
"II
"That on or about the 6th day of October, 1949, plaintiff herein bargained with defendant to buy of and from the defendant a certain 1949 Ford Convertible automobile bearing Motor No. 98-BA 863134, on the following terms and conditions, to-wit:
"That the plaintiff pay to the defendant the total initial or down payment of $849.35, and that defendant would procure THE FIRST NATIONAL BANK OF PORTLAND, OREGON to carry remaining portion of purchase price in the sum of $2,005.00, together with finance charges thereon on an assigned conditional contract of sale in thirty equal monthly installments of $65.00 each;
"III
"That at the same time that the plaintiff herein bargained with defendant to buy said certain automobile, it was agreed by and between the plaintiff and the defendant that if the defendant could procure THE FIRST NATIONAL BANK OF PORTLAND, OREGON to carry the remaining portion of said purchase price, as aforesaid, the plaintiff could pay the initial or down payment as follows:
"The sum of $451.48 by way of Bill of Sale to plaintiff's 1941 Buick Convertible automobile, said sum representing the plaintiff's equity therein, and the further sum of $49.35 upon taking delivery of the hereinbefore described Ford automobile, and the further sum of $100.00 on the 15th day of each and every month thereafter until the remaining sum of $300.00 shall have been paid;
"IV
"That the plaintiff thereupon delivered to defendant a bill of sale to his said 1941 Buick convertible *699 automobile, together with the sum of $49.35, and two of the hereinbefore described monthly installments on the aforementioned initial or down payment, in the sum of $100.00 each;
"V
"That before the remaining $100.00 payment on the initial or down payment hereinbefore mentioned was due and owing by plaintiff to defendant, defendant informed plaintiff that it was unable to perform the condition by it to be made and performed, to-wit: the procurement of the FIRST NATIONAL BANK OF PORTLAND, OREGON, to carry by way of an assigned Conditional Contract of Sale the remaining principal balance, together with interest and finance charges due, in thirty equal installments of $65.00 each;
"VI
"That after it was ascertained that the defendant was unable to perform the conditions upon which said bargain was predicated, the plaintiff demanded the return of his said Buick automobile and all of the money he had paid under the terms of said bargain, but that defendant refused and still refuses to pay same to plaintiff;
"VII
"That as a result of the premises, there is now due and owing from defendant to plaintiff the total sum of $700.83, no part of which has been paid, notwithstanding demand therefor;
"WHEREFORE, Plaintiff demands judgment against defendant in the sum of $700.83, and his costs and disbursements herein incurred."
The sole question for determination here is whether the defendant abused his discretion in sustaining the motion to discharge the attachment and entering an order of discharge.
*700 Insofar as applicable to this case, § 7-201, OCLA, as amended by ch. 183, Oregon Laws 1941, provides:
"* * * The plaintiff, at the time of issuing the summons, or any time afterwards, may have the property of the defendant attached, as security for the satisfaction of any judgment that may be recovered, unless the defendant give security to pay such judgment, as in this chapter provided, in the following cases:
"1. In an action upon a contract, express or implied, for the direct payment of money, and which is not secured by mortgage, lien or pledge upon real or personal property, or if so secured, when such security has been rendered nugatory by the act of the defendant."
No question was raised in the original action by the defendant therein as to the sufficiency of either the affidavit or the undertaking for the writ of attachment. §§ 7-202 and 7-203, OCLA. No attempt was made by affidavit or otherwise to directly attack the facts alleged in the affidavit for attachment. The sole attack made by defendant in the original action respecting the writ of attachment rested upon the proposition that on the face of the complaint it appeared that the cause of action alleged was not one in which plaintiff was entitled to the writ pursuant to the above quoted provisions of § 7-201, OCLA.
It clearly appears from the complaint in the original action that plaintiff is proceeding upon the theory of a rescission of the contract of sale and purchase. Manifestly, the complaint does not attempt to state a cause of action for damages for breach of contract. The complaint may be defective in alleging plaintiff's cause of action  defendant, in the action, has demurred to it , but, if so, it may be amended. Suksdorff v. Bigham, 13 Or 369, 12 P 818. Such necessary amendment, if *701 made, would not affect plaintiff's rights as to attachment. Note, 74 ALR 912.
4-6. Upon proper and justified rescission of a contract of sale, the purchaser is entitled to a return of the money paid on the purchase price. Weiss v. Gumbert, 191 Or 119, 227 P2d 812. If the seller refuses to return the money, then the purchaser may sue in assumpsit to recover it. Weiss v. Gumbert, supra. The law implies an agreement upon the part of the seller to make such repayment; it is an implied contract within the meaning of § 7-201, OCLA, as amended by ch. 183, Oregon Laws 1941. Hanley v. Combs, 48 Or 409, 412, 87 P 143.
In the instant case no uncertainty exists as to the amount of money plaintiff paid on the purchase price and which he is entitled to recover upon rescission. He delivered his Buick automobile to the seller at the agreed price of $451.48 and paid $249.35 in cash. This totals $700.83, for which sum he demanded judgment. True, the automobile was not money, but its value was fixed between the parties, and when defendant refused to return the car to plaintiff, the plaintiff was entitled to recover its agreed value in lieu thereof.
The complaint states a cause of action in which plaintiff was entitled to have a writ of attachment issue; a cause of action based upon an implied contract for the direct payment of money.
The defendant judge erred in discharging the attachment on the grounds set forth in his answer to the writ.
But defendant argues that his ruling and order were within his discretion, and that there was no abuse of discretion in making them. He contends that he had jurisdiction to pass upon the motion; that this jurisdiction vested him with the power to decide erroneously *702 as well as correctly; and that, for a mistake in judgment, it cannot be said that he abused his discretion.
7. Section 11-302, OCLA, respecting the issuance of a writ of mandamus, provides:
"* * * It may be issued to any inferior court, corporation * * * to compel the performance of an act which the law specially enjoins, as a duty resulting from an office, trust, or station; but though the writ may require such court, corporation * * * to exercise its or his judgment, or proceed to the discharge of its or his functions, it shall not control judicial discretion. The writ shall not be issued in any case where there is a plain, speedy, and adequate remedy in the ordinary course of the law." (Italics ours.)
"Judicial discretion", as used in the statute, means the option which a judge may exercise either to do or not to do that which is proposed to him that he shall do; it is the right to choose between the doing and not doing of a thing, the doing of which cannot be demanded as an absolute right of the party asking it to be done; it is the exercise of the right legally to determine between two or more courses of action.
In 27 CJS, Discretion, 135, it is stated:
"* * * In every court of general jurisdiction there resides authority which is not strictly defined or limited by fixed rules of law, but which must be exercised in order to vindicate substantive rights, properly frame issues, and duly conduct trials. This authority may be said, in a general way, to be the power of the judge to rule and decide as his best judgment and sound discretion dictate; and the term `judicial discretion' or `discretion of the court' is usually employed as designating the power mentioned." (Italics ours.)
*703 In State v. Lewis, 113 Or 359, 364, 230 P 543, 232 P 1013, this court, speaking through the late Justice RAND, said:
"Discretion is the power exercised by courts to determine questions to which no strict rule of law is applicable, but which from their nature and the circumstances of the case are controlled by the personal judgment of the court: Bouvier's Law Dict. It cannot be exercised where a strict rule of law is applicable as the term `discretion' implies the absence of any such rule. Where there is a clearly defined and well-settled applicable rule of law the courts are bound to enforce the rule and discretion is at an end. * * *." (Italics ours.)
8, 9. "Judicial discretion" never authorizes arbitrary, capricious action that tends to defeat the ends of substantial justice. Where the facts are in dispute, or where there is no strict rule of law applicable, the exercise of a sound discretion by the trial judge in such circumstances cannot be disturbed or controlled in a proceeding by mandamus, no matter how erroneous his ruling may be. He has the power to decide erroneously as well as correctly, and the only remedy for the correction of error is by appeal.
10. However, where the facts are not in dispute, and there exists a strict rule of law that is applicable, no question of "judicial discretion" arises. The trial judge is under the positive duty of correctly applying the applicable rule of law. In Riesland v. Bailey, 146 Or 574, 580, 31 P2d 183, 92 ALR 1207, this court stated the rule as follows:
"Where the discretion is as to the existence of facts entitling the relator to the thing demanded, if the facts are admitted or clearly proved, mandamus will lie to compel action according to law * * *."
*704 See also State ex rel. Scott v. Dobson, 171 Or 492, 135 P2d 794, 137 P2d 825.
11. In the instant case there is no dispute as to the facts, and there is a strict rule of law that is applicable. In an action based upon an implied contract for the direct payment of money, the plaintiff, by force of the statute, has an absolute right to attach property of the defendant; provided he make and file the necessary affidavit and undertaking for attachment. This the plaintiff did in the action he commenced. The facts being undisputed, and the statutory rule of law vesting in plaintiff an absolute right as it does, the trial judge had no discretion to do other than apply that law. In truth, he had no discretion, and, hence, his action does not come within the rule that judicial discretion will not be reviewed, no matter how erroneous.
It is obvious that plaintiff had no remedy by appeal from the order of the court discharging the attachment. To present the error of the court with respect to that on appeal, plaintiff would be compelled to await the entry of final judgment in the case. Under the facts appearing in the writ, such a review would be an idle thing and would in no way protect plaintiff's statutory rights, because, as appears from the writ, defendant in the original action is insolvent. The defendant in this proceeding, in his answer to the writ, does not deny that allegation of insolvency, and, for the purposes of this case, it stands admitted. Unless relief is given by mandamus, the security plaintiff obtained on attachment for the satisfaction of any judgment recovered will be completely lost and destroyed, and such judgment as he may obtain will be valueless.
12, 13. Mandamus is an extraordinary remedy, and is not a writ of right; it will never issue unless the duty sought to be enforced is one legally defined. *705 Neither will it issue where there is a plain, speedy, and adequate remedy in the ordinary course of law. However, to bar mandamus, the law remedy must afford all relief to which the relator is entitled. State ex rel. Hupp etc. Corp. v. Kanzler, 129 Or 85, 97, 276 P 273.
14, 15. The primary purpose or function of a writ of mandamus is to enforce an established right, and to enforce a corresponding imperative duty created or imposed by law. It is designed to promote justice. It may issue even where other remedies exist, if they are not sufficiently speedy to prevent material injury. Propriety of the issuance of the writ is determined by the inadequacy, and not the mere absence of other legal remedies, and the danger of a failure of justice without it. State ex rel. Pierce v. Slusher, 117 Or 498, 501, 244 P 540; CJS, Mandamus, 85, § 51.
In the instant case a miscarriage of justice would result, should the order discharging the attachment be permitted to stand. Plaintiff shows a clear legal right to have the thing done which is requested, and it also is the clear legal duty of the defendant to do the thing he is called on to do. His answer to the alternative writ of mandamus presents no defense. The demurrer thereto is sustained, and it is ordered that a peremptory writ issue.
