
306 S.W.2d 244 (1957)
Homer GARRISON, Director of Department of Public Safety, Appellant,
v.
Bobby SMITH, Appellee.
No. 15867.
Court of Civil Appeals of Texas, Fort Worth.
September 27, 1957.
*245 Hubert W. Green, Jr., Cr. Dist. Atty., Bexar County, and John G. Murray, Asst. Cr. Dist. Atty., San Antonio, for appellant.
Maynard F. Robinson, San Antonio, for appellee.
BOYD, Justice.
Appellant Homer Garrison, Director of the Department of Public Safety, refused to renew appellee Bobby Smith's commercial operator's license on the ground that in the opinion of the Director appellee's operation of a motor vehicle on the highways would be inimical to public safety and welfare. Appellee filed a petition in County Court at Law No. 1 of Bexar County alleging that the Department refused to renew his license and declined to examine him in order to ascertain whether he had the ability and capacity to drive a motor vehicle, and that such action was arbitrary and capricious, "and pursuant to Section 31 (of Article 6687b) plaintiff files this his petition for a hearing as provided to determine whether he is entitled to a renewal as above complained of. Wherefore, plaintiff prays for a hearing upon not less than ten (10) days' notice to the defendant and for a judgment after factual presentation that the plaintiff is entitled to a renewal as provided by law and a finding that the acts of defendant are arbitrary and capricious."
There was a judgment that the Department "in denying plaintiff a renewal of his commercial operator's license acted arbitrarily and capriciously because the defendant refused to permit plaintiff to be examined to determine whether or not he is entitled to a renewal of his commercial operator's license, plaintiff having duly requested such examination. The court, therefore, is of the opinion and finds that the defendant should be, and it is hereby, ordered and directed to examine plaintiff, upon his request, for the purpose of determining if plaintiff is entitled to a renewal * * * at this time." From this judgment the Department appeals.
Appellant has only one point of error, which is: "The trial court erred in finding that the Department acted arbitrarily and capriciously in refusing to renew appellee's Commercial Operator's License and in ordering the Department to give appellee a driver's test because the Department acted within its authority and upon substantial evidence."
It appears that the trial court did not set aside the order refusing to renew the license, and that the relief actually granted *246 was not prayed for, namely, the order that the Department examine appellee, upon his request, to determine whether he is entitled to such renewal.
The right of appeal from an order suspending or refusing a license is given in Section 31 of Article 6687b, Vernon's Ann. Civ.St. Although that section provides that the court on appeal may determine whether the petitioner is entitled to a license, or whether his license is subject to suspension, it has been uniformly held, we think, that such trial is governed by the substantial evidence rule and that the court may not substitute its discretion for that of the Department, but may determine only whether the Department's action was reasonably supported by substantial evidence. Texas Department of Public Safety v. Jackson, Tex.Civ.App., 272 S.W.2d 577; Texas Department of Public Safety v. Azar, Tex. Civ.App., 274 S.W.2d 911; Department of Public Safety v. Robertson, Tex.Civ.App., 203 S.W.2d 950, and authorities there cited. The substantial evidence rule also governs the action of an appellate court when such appeals are prosecuted.
Judgments must conform to the pleadings. Rule 301, Texas Rules of Civil Procedure. A judgment not supported by pleadings is erroneous. Starr v. Ferguson, 140 Tex. 80, 166 S.W.2d 130; City of Fort Worth v. Gause, 129 Tex. 25, 101 S.W.2d 221; Hart v. Hunter, 52 Tex.Civ. App. 75, 114 S.W. 882; Stanley v. King, 45 Tex.Civ.App. 415, 101 S.W. 524; Houston, E. & W. T. Ry. Co. v. Skeeter Bros., 44 Tex.Civ.App. 105, 98 S.W. 1064.
Although appellee alleged that the Department refused to give him an examination, he did not ask for an order requiring that to be done; and it is not clear to us how, in a trial where the only issue was whether the Department's action in refusing to renew the license was reasonably supported by substantial evidence, the court could order such examination even if it had been prayed for. Appellee appealed from an order of an administrative agency, and he did not petition for a mandamus.
Section 4, sub. 9, of Article 6687b provides that the Department shall not issue a license to any person when it "has good cause to believe that the operation of a motor vehicle on the highways by such person would be inimical to public safety or welfare." Appellant purported to act under that statute.
Believing that the issue to be determined on the trial was whether the refusal to renew the license was reasonably supported by substantial evidence, and that the action of the Department should have been either sustained or set aside as the court might have determined that issue, we think the judgment is erroneous and that the cause should be remanded.
Reversed and remanded.
