Query distinct fail on 10.5 with field longer than 22 char

1701
8
10-13-2017 11:22 AM
FrancisGagne
New Contributor

I'm trying to get the domain of value for a field with 23 characters and it fails.

Here is the query I'm doing on 10.5:

queryf=json

&where=1=1

&returnGeometry=false

&spatialRel=esriSpatialRelIntersects

&outFields=UTILISATEURMODIFICATION

&returnDistinctValues=true

&orderByFields=UTILISATEURMODIFICATION

It returns 

{"error":{"code":400,"message":"Failed to execute query.","details":[]}}

When I remove the returnDistinctValues, it works fine but I get every records.

I tried the same exact query on 10.3 with the same MXD and data and the returnDistinct works fine.

Here is the log from the server:

Geodatabase error: Attribute column not found [42S22:[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'UTILISATEURMODIFICATIO'.] .

It seems the last characters are truncated. I have the same problem with other fields:

Geodatabase error: Attribute column not found [42S22:[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'INDICATEURPROTECTIONGE'.] 
0 Kudos
8 Replies
VinceAngelo
Esri Esteemed Contributor

If you prepend the column name with "DISTINCT ", the field contents becomes 31 characters long, which happens to be the maximum column name length.  Very curious.

- V

0 Kudos
FrancisGagne
New Contributor

Does the limit have reduced since 10.3?

0 Kudos
VinceAngelo
Esri Esteemed Contributor

No, the underlying ArcSDE API constant, set to 32 (but not counting the string terminator) has not changed since SDE 3.0.

0 Kudos
FrancisGagne
New Contributor

Is there any update on this? I managed to get around by querying my data directly but some others might not be able to do that easily.

I just tried again on the service and I still have the same problem with long fields.

Thanks,

0 Kudos
MicahBabinski
Occasional Contributor III

What is the character length of your request URL? Are you using GET or POST?

0 Kudos
CherylHagevik
Esri Contributor

This appears to be unexpected behavior when querying with Return Distinct Values. This issue has been reported to the Product Team for further investigation as BUG-000117499 : Query fails at REST with 'Unable to perform query operation' when returning Distinct Values with outField that has name over 22 characters long. Hopefully we will see this issue addressed soon! Thanks, Cheryl

0 Kudos
WillStafford
New Contributor II

Has there been an update on this Vince.  Is it repaired. It was still active in 10.6.1 .  Setting up a 10.7.1 or 10.8 back end soon.

Will

0 Kudos
VinceAngelo
Esri Esteemed Contributor

Cheryl reported the bug number - BUG-000117499 -  which does not appear to have any updates.
I don't have anything to add here.  You might want to try Tech Support, adding your e-mail to the
notifications on this issue...

- V