Error attempting to edit query layer

1637
5
Jump to solution
09-09-2020 02:51 PM
EricIsaak
New Contributor

After successfully editing the SQL query in a query layer multiple times (~10), the next edit attempt generates a "Name is empty" error after pressing Validate. The only way to recover seems to be to create a new query layer and redo all the configuration. Has anybody experienced this behavior?

1 Solution

Accepted Solutions
TristanMcHardie
New Contributor III

For me, this seems to have stemmed from the layer's "Alias" (see Layer Properties > Source > Alias) being appended with _1, then _1_2, then _1_2_3, etc. until it reached 68 characters.

My workaround was to export the layer as a Layer File (.lyrx), edit the file using a text editor to remove the _1_2_3 suffix, and then replace the layer from the layer file. This way, you don't have to re-apply any symbology, labelling, scale ranges etc. which you would if you recreate the query layer from scratch.

This workaround might also be achieved using arcpy by modifying the layer's CIM, but I haven't tested this myself.

If anyone knows what the purpose of the alias is in query layers I'd be pleased for an explanation, particularly the % sign and suffixes that get inserted/appended.

View solution in original post

5 Replies
MikeNelsonOP
New Contributor II

I am experiencing the same problem and had to do the same workaround as you. I don't know of another way around this.

0 Kudos
kshahmmp
New Contributor II

I have the same issue too

0 Kudos
LaurentP
New Contributor II

I have the same issue as well

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

A known bug. BUG-000134052 

Currently, there is no other documented workaround than to create a new query layer.



Think Location
0 Kudos
TristanMcHardie
New Contributor III

For me, this seems to have stemmed from the layer's "Alias" (see Layer Properties > Source > Alias) being appended with _1, then _1_2, then _1_2_3, etc. until it reached 68 characters.

My workaround was to export the layer as a Layer File (.lyrx), edit the file using a text editor to remove the _1_2_3 suffix, and then replace the layer from the layer file. This way, you don't have to re-apply any symbology, labelling, scale ranges etc. which you would if you recreate the query layer from scratch.

This workaround might also be achieved using arcpy by modifying the layer's CIM, but I haven't tested this myself.

If anyone knows what the purpose of the alias is in query layers I'd be pleased for an explanation, particularly the % sign and suffixes that get inserted/appended.