Queries on Shape.STArea() at level of ArcGIS Server

3033
4
Jump to solution
10-25-2014 07:43 AM
HaniDraidi
Occasional Contributor II

I have a parcels layer in an enterprise SQL Server Geodatabase (.mdf), when I perform a query on the layer to get the parcels with area larger than 100,000 m2 using find by attributes-dialog box (using “Shape.STArea()>=100000”), it returns the required set of parcels. But, when publishing a map service that contains this layer, and trying to run the same query at the level of ArcGIS Server it does not return any value, whereas it returns values for queries on other fields like ObjectID. What might be the issue here? This is shown with screenshots below.

Thank you.

Hani

________________________________________________________________

1- Query using find by attributes

Clip_727.jpg

2- The Query runs fine returns the right parcels

Clip_728.jpg

3- Query at the level of ArcGIS

Clip_729.jpg

4- The query fails

Clip_730.jpg

5-  A query with ObjectID field at level of ArcGIS; it runs well!!

Clip_731.jpg

1 Solution

Accepted Solutions
TanuHoque
Esri Regular Contributor

Hani,

Unfortunately this is known limit when you have StandardardizedQueries enabled.

If you data are not sensitive, then you may consider disabling StandardizedQueries or copy values from Shape.STArea() field to a separate field and query on that new field -- these are workarounds I can think of.

View solution in original post

4 Replies
TanuHoque
Esri Regular Contributor

Hani,

Unfortunately this is known limit when you have StandardardizedQueries enabled.

If you data are not sensitive, then you may consider disabling StandardizedQueries or copy values from Shape.STArea() field to a separate field and query on that new field -- these are workarounds I can think of.

HaniDraidi
Occasional Contributor II

Many thanks Tanu!

I disabled standardized Queries, and then the query went well, but still I don't understand how this affects me? can you elaborate? I referred to your link but I didn't catch the point.

0 Kudos
RonnieRichards
Occasional Contributor III

You could also create a spatial view and include the area column with an alias and publish the spatial view so StandardizedQueries can remained enabled. StandardizedQueries provides the ability to be cross-db compliant and saftey from SQL injection attacks.

HaniDraidi
Occasional Contributor II

Thank you Ronnie for your valuable input, could you please elaborate more with screenshots?

0 Kudos