
    In the Matter of Fulton Cama, Inc. et al., Respondents, v Trustees of the Village of Farmingdale et al., Appellants.
   In a proceeding pursuant to CPLR article 78 to review a determination of the Village Board of the Village of Farmingdale denying petitioner Exxon Corporation a special exception permit to operate a gasoline service station, which Special Term, in effect, converted into an action to declare unconstitutional a certain provision of the Code of the Village of Farmingdale, the appeal is from a judgment of the Supreme Court, Nassau County, dated June 19, 1979, which, inter alia, granted the petition, declared the challenged ordinance unconstitutional, and vacated the determination. Judgment reversed, on the law, without costs or disbursements, and matter remitted to Special Term for further proceedings consistent herewith. In the absence of a motion for summary judgment, it was improper for Special Term to render a declaratory judgment in this action sua sponte (see CPLR 3212). Furthermore, the constitutionality of the challenged ordinance is a matter which cannot be determined solely upon the papers submitted. A trial is necessary to determine what legitimate governmental interest is intended to be served by the challenged ordinance and whether the ordinance bears a rational relationship to that interest (see Consumer-Farmer Milk Coop, v Wickham, 25 AD2d 413; Defiance Milk Prods. Co. v Du Mond, 282 App Div 977; see, also, Weiner v Valentine, 17 NYS2d 355, affd 260 App Div 999; Havemeyer v Ingersoll, 12 Abb Prac [NS] 301). Rabin, J. P., Cohalan, Margett and Gibbons, JJ., concur.  