Multi-line literal in query (MultilineStringInQuery)¶
Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
---|---|---|---|---|---|
Error |
BSL |
Critical |
Yes |
1 |
badpractice suspicious unpredictable |
Description¶
Multi-line literals are rarely used in query texts, mostly these are error results due to an incorrect number of double quotes.
Examples¶
In the example below, the selection will have two fields instead of three.
Query = New Query;
Query.Text = "SELECT
| OrderGoods.Cargo AS Cargo,
| ISNULL(OrderGoods.Cargo.Code, "") AS CargoCode, // quote error here, should be """"
| ISNULL(OrderGoods.Cargo.Name, "") AS CargoName
|FROM
| Document.Order.Goods AS OrderGoods
|WHERE
| OrderGoods.Ref = &Ref";
Sources¶
Snippets¶
Diagnostic ignorance in code¶
// BSLLS:MultilineStringInQuery-off
// BSLLS:MultilineStringInQuery-on
Parameter for config¶
"MultilineStringInQuery": false