Changed where condition of createbasequery and extended timeout of re… - #20
Open
lendrom wants to merge 1 commit into
Open
Changed where condition of createbasequery and extended timeout of re…#20lendrom wants to merge 1 commit into
lendrom wants to merge 1 commit into
Conversation
…quests Changed 'where' condition from "where":"objectid=objectid" to "where":"1=1" in createBaseQuery method of EsriVectorQueryFactoy. There is a possiblity that table or feature layer's physical structure in the database does not have a field named literally 'objectid'. One example could be query layers published by AGS or external origin tables registered with geodatabase (there are cases, when the field will be named OBJECTID_1 or that some existing column name other than objectid will be used). I'm not sure what is the 'right' way to check the name of a field that has role of objectid but if someone needs to use objectid field name in query, there are several ways to check it . For example, fields that play a role of objectidfield have type set to 'esriFieldTypeOID'. Queries for 'returnIdsOnly' also return property: 'objectIdFieldName', so it could be obtained by querying with 'returnIdsOnly' and where='1=2'. In createBaseQuery method case there's no need to look for objectid field name as 'objectid=objectid' is only an 'empty' condition. The condition "1=1" is more general and should be equally suitable. http://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/object-id.htm Timeout for queries also changed from 10 to 60 seconds.
|
Changes seem to be sensible! Many thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…quests
Changed 'where' condition from "where":"objectid=objectid" to "where":"1=1" in createBaseQuery method of EsriVectorQueryFactoy. There is a possiblity that table or feature layer's physical structure in the database does not have a field named literally 'objectid'. One example could be query layers published by AGS or external origin tables registered with geodatabase (there are cases, when the field will be named OBJECTID_1 or that some existing column name other than objectid will be used). I'm not sure what is the 'right' way to check the name of a field that has role of objectid but if someone needs to use objectid field name in query, there are several ways to check it . For example, fields that play a role of objectidfield have type set to 'esriFieldTypeOID'. Queries for 'returnIdsOnly' also return property: 'objectIdFieldName', so it could be obtained by querying with 'returnIdsOnly' and where='1=2'.
In createBaseQuery method case there's no need to look for objectid field name as 'objectid=objectid' is only an 'empty' condition. The condition "1=1" is more general and should be equally suitable.
http://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/object-id.htm
Timeout for queries also changed from 10 to 60 seconds.