Skip to content

BSL235 — Query text parsing error

Summary

Query text parsing error

Identifiers

Field Value
Rule code BSL235
Compatible alias QueryParseError
Severity WARNING
Enabled by default Yes
Implemented Yes
Tags query, correctness

Behavior

  • The public identifier BSL235 and alias QueryParseError are stable.
  • The rule reports the cases documented on this page.
  • Suppressions and project configuration are applied before publication.
  • The rule requires neither an external analyzer nor network access.

Configuration and suppression

BSL### is the primary stable identifier. The compatible alias is accepted in select, ignore, and compatible block suppression comments.

[tool.onec-hbk-bsl]
select = ["BSL235"]
ignore = ["QueryParseError"]

All three suppression families support both a current line and a range. When an opening comment follows code, it affects only that line. Use any one form:

  • noqa:
Value = "example";  // noqa: BSL235
  • bsl-disable:
Value = "example";  // bsl-disable: BSL235
  • compatible BSLLS form:
Value = "example";  // BSLLS:QueryParseError-off

When the same opening comment is on a line by itself, it starts a range. Close it with the matching marker from the same family:

// noqa: BSL235
// code without this diagnostic
// noqa-enable: BSL235

// bsl-disable: BSL235
// code without this diagnostic
// bsl-enable: BSL235

// BSLLS:QueryParseError-off
// code without this diagnostic
// BSLLS:QueryParseError-on

To disable the rule until the end of the file, omit the closing noqa-enable, bsl-enable, or BSLLS:…-on marker.

Opening and closing markers must belong to the same family.

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