Error Handling |
Top Previous Next |
enQuiry also provides error handling so that it can inform the user when malformed or illegal queries have been created. Below are a few example of errors that are likely to be displayed when they occur:
Invalid Type Conversion This can occur when a function is used on data which is not of the correct type. In this case the "Average" function attempts to find an average of a string field, which is not valid as the field has to be a numeric type:
Invalid Groupings When data is grouped, it cannot be related to other data which contains discrete values and therefore this throws an error. A typical example as we can see here, is when address data typically has a balance field for an account at each address. If a grouping takes place on data the system notices that a set of discrete values e.g. 3 or 4 addresses are grouped with a single total balance, and it is not possible to output this information onto a single row. The only way this can be rectified is to group both the address data and the balance information together.
This has not happened in this case as we can see:
To rectify this, it would be necessary to change the "For values" in the address field to "For groups" so that all the information is grouped together and the system does not find the query ambiguous.
Other Potential Errors It is possible to identify problems by looking at the SQL generated by each query. If there are problems with the SQL it is possible to amend the query and correct the mistakes, but this requires a basic knowledge of SQL. |