Select to view content in your preferred language

Error when using UPPER together with statistical functions.

3353
3
04-18-2013 10:31 AM
FabianoScardua
Emerging Contributor
REST returns an error when using the statistical functions in conjunction with the UPPER function in where clausure in a published service from a filegeodatabase. When used with a published service from an enterprise geodatabase the problem does not happen.
Also the problem does not happen when the upper it is used without the statistics functions.

Arcgis Server 10.11

Someone confirms the problem?
Tags (2)
0 Kudos
3 Replies
AdminRFVL
Occasional Contributor

I have the same issue with the 3.15 javascript API and ArcGIS Server 10.3.

Can't find a workaround, which is pretty frustrating.

0 Kudos
deleted-user-08X689byEKuE
Deactivated User

Please provide the where clause you are creating that doesn't work, exactly copy/pasted. This would help people understand your problem better.

0 Kudos
AdminRFVL
Occasional Contributor

Here is my code:

/********************************************************************************************/

var queryPCTask = new QueryTask(this.layers[0].queryParameters.url);

            var queryPC = new Query();

            queryPC.where = "UPPER(MUNICIPALITE) LIKE '%MONTRÉAL%'";

            queryPC.outFields = ["*"];

            var statisticDefinition = new esri.tasks.StatisticDefinition();

            statisticDefinition.statisticType = "count";

            statisticDefinition.onStatisticField = "TYPE_SITE_DESC";

            statisticDefinition.outStatisticFieldName = "TYPE_SITE_DESC_COUNT";

            queryPC.outStatistics = [statisticDefinition];

            queryPC.groupByFieldsForStatistics = ["TYPE_SITE_DESC"];

            queryPCTask.execute(queryPC, lang.hitch(this, 'updatePCDashboard'), lang.hitch(this, 'updatePCDashboardError'));

/********************************************************************************************/

When Executed, I get this error: Error: Unable to complete operation. at Error (native) at Object.h.load

If I modify my query to:

queryPC.where = "MUNICIPALITE LIKE '%MONTRÉAL%'"

The query task is successful.

As stated initially in this post, the problem seems to be related to the statisticDefinition because without that, I can use Upper/Lower without any problems

/********************************************************************************************/

var queryPC = new Query();

            queryPC.where = "UPPER(MUNICIPALITE) LIKE '%MONTRÉAL%'";

            queryPC.outFields = ["*"];

            queryPCTask.execute(queryPC, lang.hitch(this, 'updatePCDashboard'), lang.hitch(this, 'updatePCDashboardError'));

/********************************************************************************************/

Regards,

0 Kudos