< Previous | Next >

Completed SearchLibrary.egl file after lesson 3

This code is the version of the SearchLibrary.egl file completed after lesson 3. If you see any errors marked by red X symbols in the file, make sure your code matches this code:
package libraries;
import eglderbydb.data.Customer;

library SearchLibrary type BasicLibrary

	function NameAndStateSearch_And(lname STRING in, 
		state CHAR(2) in, customer Customer[])
		get customer with
			#sql{
				select
					CUSTOMERID, FIRSTNAME, LASTNAME, PASSWORD, PHONE, 
					EMAILADDRESS, STREET, APARTMENT, CITY, "STATE", 
					POSTALCODE, DIRECTIONS
				from EGL.CUSTOMER
				where LASTNAME like :lname 
					and "STATE" = :state
				order by
					CUSTOMERID asc
			};
	end

	function NameAndStateSearch_Or(lname STRING in, 
		state CHAR(2) in, customer Customer[])
		get customer with
			#sql{
				select
					CUSTOMERID, FIRSTNAME, LASTNAME, PASSWORD, PHONE, 
					EMAILADDRESS, STREET, APARTMENT, CITY, "STATE", 
					POSTALCODE, DIRECTIONS
				from EGL.CUSTOMER
				where LASTNAME like :lname 
					or "STATE" = :state
				order by
					CUSTOMERID asc
			};
	end
end

Return to Lesson 3: Use the OR search condition.

< Previous | Next >

Feedback