Customer Type Query

This query looks for and verifies the Customer type of the Alarm customer.

SELECT case
	when SUBTYPE = 0 then "RESIDENTIAL"
	when SUBTYPE = 1 then "COMMERCIAL"
	when SUBTYPE = 2 then "X"
	when SUBTYPE = 100 then "ELEVATOR"
	when SUBTYPE = 101 then "EMERGENCY_PHONE"
	when SUBTYPE = 102 then "LOCAL"
	end 
FROM CUSTPRIV

WHERE SERIALNO = {ME}

Some sites may only have two or three customer types.  Check the customer types within the Supervisor Workstation under Sub Types for the Company specific list.  The Sub Types Master File report may also produce this listing of Customer Types.

  • SELECT - Starts the Query.
  • CASE - Starts the values searching.
  • WHEN SUBTYPE = NUMBER - Looks for the number value of the Sub Type.
  • THEN "VALUE" - The returned value if the number is TRUE.
  • END - Closed the CASE.
  • FROM CUSTPRIV - The TABLE to find the value.
  • WHERE SERIALNO = {ME} - Searches for the alarm's customer serial number to match to the table.