Skip to content

Query text parsing error (QueryParseError)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Code smell BSL Major Yes 5 standard
sql
badpractice

Description

When writing queries, you must follow the following rule: the query text must be opened by the query designer.

This rule allows you to quickly check the correctness of the syntax of the query, as well as revision and maintenance.

Examples

Incorrect

Text = "SELECT
| Goods.Name  AS Name ,
| Goods. " + FieldNameCode + " AS Code
|From
| Catalog.Goods КАК Goods";

Correct

Text = "SELECT
| Goods.Name AS Name,
| &FieldNameCode AS Code
|FROM
| Catelog.Goods AS Goods";

Text = StrReplace(Text, 
                            "&FieldNameCode", 
                            "Goods." + FieldNameCode);

Sources

Snippets

Diagnostic ignorance in code

// BSLLS:QueryParseError-off
// BSLLS:QueryParseError-on

Parameter for config

"QueryParseError": false