Properly Formed Queries
Queries must also be well-formed, and any queries containing OR statements must be properly encapsulated in parenthesis.
Here are two examples of incorrectly formed queries:
- WKORDER WHERE (WO_STAT_CD<950 AND WO_CAT_CD = '6000' OR WO_PROB_CD = '200' ) OR WO_CAUS_CD = '1' ORDER BY WO_STRT_DT
- WKORDER WHERE WO_STAT_CD <950 OR WO_USER6 <> 0
Here are two examples of correctly formed queries
- WKORDER WHERE ((WO_STAT_CD<950 AND (WO_CAT_CD = '6000' OR WO_PROB_CD = '200')) OR WO_CAUS_CD = '1') ORDER BY WO_STRT_DT
- WKORDER WHERE (WO_STAT_CD<950 OR WO_USER6<>0)