Database view error WhereClause invalid token or Unknown column in on clauseIssue One of the following errors appears in the UI or in the application logs: ERROR WhereClause - invalid tokenSyntax Error or Access Rule Violation detected by database: Unknown column 'prefix_u_field' in 'on clause'. In this error, prefix_u_field is present in one of the where or join clauses of the database view.Where clause in view 'view_name' has an invalid field or a field that is not visible (SUBSTRING_INDEX) Release Beginning with London Cause The first error occurs when the Where clause of a sys_db_view_table record contains an unexpected character. A period (.) in the where clause of a join table stops the system from parsing the rest of the condition. The system does not parse the prefix_field syntax in the join or where condition. It reads the syntax as a literal field name, which does not exist. This produces the second error. The last error occurs when a SQL function is added to the where or join clause. The underscore (_) in the function name is parsed as a prefix_field combination. No view table has that prefix, so the error occurs. The documentation does not list SQL functions in the where or join clause as supported. Using them can cause the view not to run. Resolution Write the Where clause with the table prefix, an underscore, and the field name. For example: In a Where clause, mi_id refers to the id field in the Metric Instance [metric_instance] table (mi)In a Where clause, inc_sys_id refers to the sys_id field in the Incident [incident] table (inc) You might reference fields with the standard JavaScript syntax, such as inc.sys_id. The Where clause expects inc_sys_id instead. The Where clause supports the following JavaScript conditional operators for comparing table fields: =, !=, <, <=, >, >=, &&, || To fix an existing view that returns one of these errors: Find any period (.) used between a table prefix and a field name in the Where clause. Replace it with an underscore, for example, change inc.sys_id to inc_sys_id.Remove any SQL function from the where or join clause. Related Links Add a table to the database view