
683 So.2d 822 (1996)
Herman BUSTAMENTE
v.
JEFFERSON PARISH INSPECTION & CODE ENFORCEMENT, et al.
No. 96-CA-320.
Court of Appeal of Louisiana, Fifth Circuit.
October 1, 1996.
*823 James E. Stovall, Covington, for Plaintiff/Appellant.
Ronald J. Gillen, Assistant Parish Attorney for Jefferson Parish, Metairie, for Defendant/Appellee.
Before BOWES, GRISBAUM and GOTHARD, JJ.
GOTHARD, Judge.
Plaintiff, Herman Bustamente, appeals a judgment that granted an exception of no cause of action brought by defendants, Jefferson Parish and the Jefferson Parish Department of Inspection and Code Enforcement. For the following reasons, we vacate, annul and set aside.

FACTS/PROCEDURAL HISTORY
Plaintiff owns property located at 2404 Transcontinental Drive in Jefferson Parish. The adjoining property, located at 2408 Transcontinental Drive, was originally owned by Gaspar Zappula. Plaintiff contends that at all relevant times he enjoyed a natural servitude of drainage arising from the location *824 of the two properties and their relationship to each other.
In late 1992, Mr. Zappula began raising his property by adding fill to the rear, side, and front yards. According to plaintiff, the raising of the adjoining property caused his property to flood. Plaintiff complained to the Jefferson Parish Department of Inspection and Code Enforcement, which cited Mr. Zappula for violations of the building code and related ordinances. In response, Mr. Zappula did not remove the fill, but instead installed a chain wall. The Department of Inspection and Code Enforcement eventually determined that Mr. Zappula's property complied with all codal requirements and accordingly dismissed the previous violations. Subsequently, Mr. Zappula sold the property to Rodney Redler.
Plaintiff alleges that following the parish's approval of Mr. Zappula's modifications his property continued to flood. On March 16, 1994, plaintiff filed suit, naming as defendants Jefferson Parish and the Jefferson Parish Department of Inspection and Code Enforcement (hereinafter referred to collectively as "the Parish"), Mr. Zappula, and Mr. Redler. The petition requested that a writ of mandamus be directed to the Parish ordering that it rescind its dismissal of the violation at 2408 Transcontinental Drive and require compliance with all relevant ordinances. In addition, the petition sought damages from the defendants.
On June 6, 1994, an exception of no cause of action was filed by the Parish. The exception was based on La.R.S. 33:4773(D), which makes the performance of any enforcement procedure in connection with any building code a discretionary act, and La.R.S. 9:2798.1(B), which states that public entities or their employees are not liable for performing or failing to perform discretionary acts. In a memorandum in opposition to the exception, plaintiff argued that the foregoing statutes are unconstitutional. The attorney general was not served with a copy of any of the pleadings.
The hearing on the exception was held on September 18, 1995. The trial court took the matter under advisement and, on October 16, 1995, rendered judgment in favor of the Parish, granting its exception of no cause of action and dismissing it from the suit.[1] The judgment did not address the constitutional challenge raised by plaintiff. From this judgment, plaintiff has appealed.

ASSIGNMENT OF ERRORS
Plaintiff's sole assignment of error is that the trial court erred in failing to find La.R.S. 33:4773(D) and La.R.S. 9:2798.1(B) unconstitutional. The remedy sought by plaintiff is for this court to remand the case to the trial court so that it can conduct a hearing on the constitutionality of the two statutes.

LAW
An exception of no cause of action questions "whether the law extends a remedy to anyone under the factual allegations of the petition." Ferguson v. Dirks, 95-560 (La. App. 5th Cir.1995), 665 So.2d 585. Writs of mandamus are authorized by La.C.C.P. art. 3861. The writ is issued to a public officer and compels him to perform any ministerial duty required by law. La.C.C.P. art. 3863. The jurisprudence establishes that discretionary duties, in contrast to ministerial duties, are not the proper subject of a mandamus action. See Ass'n of Louisiana Bail Underwriters v. Johnson, 615 So.2d 1345 (La.App. 5th Cir.), writ denied, 617 So.2d 1184 (La.1993); Cummings v. Harahan Mun. Fire and Police Civil Serv. Bd., 590 So.2d 1359 (La.App. 5th Cir.1991), as amended (1/31/94).
La.R.S. 33:4773(D), one of the statutes relied on by the Parish, provides as follows:
The performance of any enforcement procedure in connection with any building code shall be deemed to be a discretionary act and shall be subject to the provisions of R.S. 9:2798.1. In connection with the construction of any building, structure, or other improvement to immovable property, neither the performance of any enforcement procedure nor any provision of a building code shall constitute or be construed as a warranty or guarantee by an *825 enforcement agency as to durability or fitness, or as a warranty or guarantee by an enforcement agency that said building, structure, or other improvement to immovable property or any material, equipment, or method or type of construction used therein is or will be free from defects, will perform in a particular manner, is fit for a particular purpose, or will last in any particular way.
La.R.S. 9:2798.1(B), referred to above, provides as follows:
Liability shall not be imposed on public entities or their officers or employees based upon the exercise or performance or the failure to exercise or perform their policy making or discretionary acts when such acts are within the course and scope of their lawful powers and duties.

DISCUSSION
Plaintiff seeks issuance of a writ of mandamus to the Parish, ordering it to revoke its dismissal of the violation at 2408 Transcontinental Drive. After reviewing the applicable law, we conclude that no action for mandamus lies in this situation. Based on the plain language of La.R.S. 33:4773(D), the Parish's dismissal of the violation at 2408 Transcontinental Drive amounted to a discretionary act. Because the act complained of was discretionary, plaintiff has no cause of action for mandamus against the Parish. See Ass'n of Louisiana Bail Underwriters; Cummings; supra.
In addition, La.R.S. 9:2798.1(B) provides the Parish immunity from damages for performing or failing to perform discretionary acts. Thus, plaintiff cannot recover damages from the Parish for its performing or failing to perform enforcement procedures in regard to the property located at 2408 Transcontinental Drive. It is well settled that damages are an essential element of either a contractual or a delictual cause of action. La.C.C. art. 2315; Fowler v. Roberts, 556 So.2d 1 (La.1989); Cahoon v. USAA Casualty Ins. Co., 95-395 (La.App. 5th Cir. 10/31/95), 663 So.2d 534, writ denied, 95-3020 (La.2/9/96), 667 So.2d 540. Because plaintiff cannot recover damages from the Parish, his purported cause of action lacks an essential element and is thus invalid. In short, then, the trial court did not err in sustaining the Parish's exception of no cause of action.
Plaintiff, however, argues that the statutes relied on by the Parish to support its exception, when read together, violate Article 12, Section 10 of the Louisiana Constitution of 1974, which provides that "[n]either the state, a state agency, nor a political subdivision shall be immune from suit and liability in contract or for injury to person or property." The trial court did not address the constitutionality of La.R.S. 33:4773(D) and La.R.S. 9:2798.1(B). Plaintiff argues that the court erred in failing to find the statutes unconstitutional, and requests that we remand the case so that a hearing may be held on the matter. The question, then, is whether plaintiff properly placed before the trial court the issue of the constitutionality of the statutes relied on by the Parish in its exception.
The leading case on the proper procedure for attacking the constitutionality of a statute is Vallo v. Gayle Oil Co., Inc., 94-1238 (La.11/30/94), 646 So.2d 859. In Vallo, our supreme court reiterated the long-standing rule that a statute must first be questioned in the trial court, rather than on appeal.[2]Id. at 864. Further, the court noted that the unconstitutionality of a statute must be specially pleaded and the grounds for the claim particularized.[3]Id. at 865.
*826 In defining the requirement that the allegation of unconstitutionality be specially pleaded, the court referred to La.C.C.P. art. 852, which states that the "pleadings allowed in civil actions ... shall be in writing and shall consist of petitions, exceptions, written motions, and answers." Based on the foregoing article, the court concluded that, in order to specially plead the unconstitutionality of a statute, the "claim must be raised in a petition (the original petition, an amended and supplemental petition or a petition in an incidental demand), an exception, a motion or an answer." Id. Specifically, the court stated that a claim of unconstitutionality may not be "raised in a memorandum, opposition or brief as those documents do not constitute pleadings." Id.
Having reviewed the record, we find that plaintiff did not properly raise the issue of the constitutionality of La.R.S. 33:4773(D) and La.R.S. 9:2798.1(B) before the trial court. Plaintiff challenged the constitutionality of the two statutes in his memorandum in opposition to the Parish's exception of no cause of action. However, as the supreme court stated in Vallo, raising a constitutional claim in a memorandum does not satisfy the requirement that the claim be specially pleaded because a memorandum is not a pleading. See La.C.C.P. art. 852. Thus, we have no choice but to conclude that the constitutional issue was not properly placed before the trial court. Accordingly, we hold that the court did not err in failing to address the constitutionality of La.R.S. 33:4773(D) and La.R.S. 9:2798.1(B).
Although the trial court did not err in examining the issue of constitutionality on the merits, it did err in failing to allow plaintiff time to amend his petition.
Code of Civil Procedure article 934 provides that when the grounds for a peremptory exception may be removed by amendment, the judgment shall order amendment of the petition within the delay allowed by the court. By amending his petition to add allegations of the unconstitutionality of La. R.S. 33:4773(D) and La. R.S. 9:2798.1(B), plaintiff can remove the grounds of the exception. Because the district court has not had the opportunity to establish a time frame for amendment, the case is remanded to the trial court.
Based on the foregoing, the judgment appealed from is vacated, annulled and set aside and the matter is remanded to the district court for further action not inconsistent with this opinion.
VACATED, ANNULLED & SET ASIDE.
NOTES
[1]  The judgment also denied a motion for summary judgment filed by Mr. Zappula.
[2]  There are certain exceptions to this rule, e.g., when the statute applicable to the specific case becomes effective after the appeal is lodged in the appellate court, Long v. Northeast Soil Conservation Dist. of Louisiana, 226 La. 824, 77 So.2d 408 (La.1954); or when the statute has been declared unconstitutional in another case, Harris v. Monroe Bldg. & Loan Ass'n, 185 La. 289, 169 So. 343 (La.1935). None of the recognized exceptions are applicable in the instant case; thus, plaintiff was required to raise the constitutional issue in the trial court.
[3]  The court also explained that the attorney general should be served a copy of the pleading which contests the constitutionality of the statute; however, the court noted that he is not an indispensable party unless the proceeding is an action for declaratory judgment. Vallo, 646 So.2d at 864; see La.C.C.P. art. 1880. In the instant case, the attorney general was not served with any of the pleadings. However, this is not a declaratory judgment action so plaintiff's failure to serve the attorney general is not fatal.
