错误

错误:无法绘制单个或多个图层:使用了无效的 SQL 语句。[ ]

Last Published: February 12, 2024

错误消息

When labeling features with 'define classes of features and label each class differently', the following error message is returned and no labels appear on the map:

"One or more layers failed to draw: An invalid SQL statement was used. [ ]"

原因

On the Layer Properties dialog box > Labels tab, multiple label classes can be defined for a single layer in the Method drop-down list. Each label class is defined by a SQL query. If this query has invalid syntax, this error message appears and labels are not drawn.

It is possible to get label classes with invalid SQL syntax by using the Get Symbology Classes option. Clicking this button automatically builds label classes to match the symbology classes. The above error message can occur because of the following reasons:

  • A comma is used as the decimal delimiter, such as in German, French, Italian, Lithuanian, etc.
  • The symbology is classified, for example, graduated colors or graduated symbols.
  • The class breaks are decimal delimited. For example, the value field is a double, or normalizing is used to create breaks that contain decimal delimiters.

解决方案或解决方法

Correct the invalid SQL syntax by editing the query for each label class.

  1. Open the ArcMap Layer Properties dialog box.
  2. Select the Labels tab.
  3. Select a label class from the Class drop-down list.
  4. Click the SQL Query button to open the Query Builder dialog box.
  5. Modify the SQL query.
Note:
For the scenario stated in the cause, use a period (.) instead of a comma (,) as a decimal delimiter.
Incorrect:
"AREA" > 66,063000  AND "AREA" <= 70812,056000 
Correct:
"AREA" > 66.063000  AND "AREA" <= 70812.056000
  1. Click Verify to insure the SQL state is valid.
  2. Click OK to close the Query Builder dialog box.
  3. Repeat Steps 3 through 7 for each label class.
  4. Make sure there is a check mark next to the Label features in this layer option.
  5. Click OK to close the Layer Properties dialog box and draw the labels.

文章 ID: 000005349

接收通知并查找新问题或常见问题的解决方案

从我们全新的 AI 聊天机器人中获得简明答案和视频解决方案。

下载 Esri 支持应用程序

相关信息

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项