This query Looks for specific Zone Descriptions. This is a Case query that can be modified for the values to seek.
The queries provided should be tested to ensure they meet the customer's specific needs. The company makes no guarantees regarding their accuracy or suitability.
SELECT DESCR= CASE WHEN DESCR LIKE "%motion%" THEN "MOTION" ELSE "REGULAR" END FROM SZONES WHERE SERIALNO={ME} and ZONE = {ZN}
- SELECT COLNAME - The column name in the TABLENAME table the query is looking to find the values.
- CASE - Starts the Search parameters.
- WHEN COLNAME LIKE "%value%" - Sets the data value in the Description to find. The Double quotes are required for Manitou to understand apply the query properly.
- THEN "VALUE" - The output value if the WHEN is TRUE.
- ELSE "VALUE" - The output value if NONE of the WHEN Case items are TRUE.
- END - Closes out the CASE.
- FROM TABLENAME - determines what table to seek the column value.
- WHERE - Filters the data to get exact values.
- SERIALNO={ME} - Finds the Serial number of this alarm's customer record to find the match.
- and - strings together WHERE values.
- ZONE = {ZN} - Matches the alarm zone to find the appropriate row.