arcpy Select_analysis where_clause objectidWhat is the best way to migrate an SDE DatabaseArcpy to copy a...
Term for the "extreme-extension" version of a straw man fallacy?
Proof of work - lottery approach
How do I find the solutions of the following equation?
How does the UK government determine the size of a mandate?
Risk of infection at the gym?
Would a high gravity rocky planet be guaranteed to have an atmosphere?
Unreliable Magic - Is it worth it?
Do the temporary hit points from the Battlerager barbarian's Reckless Abandon stack if I make multiple attacks on my turn?
How does buying out courses with grant money work?
How did Arya survive the stabbing?
Is this apparent Class Action settlement a spam message?
Did the DC-9 ever use RATO in revenue service?
Is exact Kanji stroke length important?
How do scammers retract money, while you can’t?
Sort a list by elements of another list
What is the best translation for "slot" in the context of multiplayer video games?
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
Implement the Thanos sorting algorithm
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
Is there a korbon needed for conversion?
How to write papers efficiently when English isn't my first language?
Roman Numeral Treatment of Suspensions
Where does the Z80 processor start executing from?
Increase performance creating Mandelbrot set in python
arcpy Select_analysis where_clause objectid
What is the best way to migrate an SDE DatabaseArcpy to copy a layer in the ArcMap TOC, rename the copy, and paste back to TOC?ArcGIS Copy Features tool extremely slow when exporting to ArcSDE?Backup several SDE database connectionsFeature class to Feature class not workingGetting full path of empty sde feature datasets (Children property from arcpy.Describe object won't work))In_memory workspace in geoprocessing servicesWhat are the options for accessing Oracle geodatabase data using full-blown SQL?Copy multiple feature-class schemas to new geodatabaseOptimizing combining multiple feature classes into one via arcpy
Trying to copy features from sde to fgdb but only when the objectid is below a certain number.
outpath = r'C:UsersCHOKDesktopSDE Conversion ProjectTEST.gdb'
query = '"objectid" < ' + "'121'"
for featureclass in dataset:
if featureclass == 'Contour_10m':
output = outpath + os.sep + featureclass
arcpy.Select_analysis(featureclass, output, query)
The code executes but only the schema of the sde is copied in the new feature class created in the gdb and no data with objectid<121 that I expected would be copied over is present.
Any ideas on what the issue is?
arcpy enterprise-geodatabase file-geodatabase
New contributor
add a comment |
Trying to copy features from sde to fgdb but only when the objectid is below a certain number.
outpath = r'C:UsersCHOKDesktopSDE Conversion ProjectTEST.gdb'
query = '"objectid" < ' + "'121'"
for featureclass in dataset:
if featureclass == 'Contour_10m':
output = outpath + os.sep + featureclass
arcpy.Select_analysis(featureclass, output, query)
The code executes but only the schema of the sde is copied in the new feature class created in the gdb and no data with objectid<121 that I expected would be copied over is present.
Any ideas on what the issue is?
arcpy enterprise-geodatabase file-geodatabase
New contributor
You're testing objectid (Long Integer) with a string, query = 'objectid < 121' will do the job. Better still query = '{} < 121'.format(arcpy.Describe(featureclass).OIDFieldName) to get the name of the OID field, Objectid for geodatabases, FID for shapefiles - makes the code more flexible. Also output = os.path.join(outpath,featureclass) instead of simple concatenation is good practice, it automatically inserts os.sep between the strings.
– Michael Stimson
7 mins ago
add a comment |
Trying to copy features from sde to fgdb but only when the objectid is below a certain number.
outpath = r'C:UsersCHOKDesktopSDE Conversion ProjectTEST.gdb'
query = '"objectid" < ' + "'121'"
for featureclass in dataset:
if featureclass == 'Contour_10m':
output = outpath + os.sep + featureclass
arcpy.Select_analysis(featureclass, output, query)
The code executes but only the schema of the sde is copied in the new feature class created in the gdb and no data with objectid<121 that I expected would be copied over is present.
Any ideas on what the issue is?
arcpy enterprise-geodatabase file-geodatabase
New contributor
Trying to copy features from sde to fgdb but only when the objectid is below a certain number.
outpath = r'C:UsersCHOKDesktopSDE Conversion ProjectTEST.gdb'
query = '"objectid" < ' + "'121'"
for featureclass in dataset:
if featureclass == 'Contour_10m':
output = outpath + os.sep + featureclass
arcpy.Select_analysis(featureclass, output, query)
The code executes but only the schema of the sde is copied in the new feature class created in the gdb and no data with objectid<121 that I expected would be copied over is present.
Any ideas on what the issue is?
arcpy enterprise-geodatabase file-geodatabase
arcpy enterprise-geodatabase file-geodatabase
New contributor
New contributor
New contributor
asked 9 mins ago
user139485user139485
61
61
New contributor
New contributor
You're testing objectid (Long Integer) with a string, query = 'objectid < 121' will do the job. Better still query = '{} < 121'.format(arcpy.Describe(featureclass).OIDFieldName) to get the name of the OID field, Objectid for geodatabases, FID for shapefiles - makes the code more flexible. Also output = os.path.join(outpath,featureclass) instead of simple concatenation is good practice, it automatically inserts os.sep between the strings.
– Michael Stimson
7 mins ago
add a comment |
You're testing objectid (Long Integer) with a string, query = 'objectid < 121' will do the job. Better still query = '{} < 121'.format(arcpy.Describe(featureclass).OIDFieldName) to get the name of the OID field, Objectid for geodatabases, FID for shapefiles - makes the code more flexible. Also output = os.path.join(outpath,featureclass) instead of simple concatenation is good practice, it automatically inserts os.sep between the strings.
– Michael Stimson
7 mins ago
You're testing objectid (Long Integer) with a string, query = 'objectid < 121' will do the job. Better still query = '{} < 121'.format(arcpy.Describe(featureclass).OIDFieldName) to get the name of the OID field, Objectid for geodatabases, FID for shapefiles - makes the code more flexible. Also output = os.path.join(outpath,featureclass) instead of simple concatenation is good practice, it automatically inserts os.sep between the strings.
– Michael Stimson
7 mins ago
You're testing objectid (Long Integer) with a string, query = 'objectid < 121' will do the job. Better still query = '{} < 121'.format(arcpy.Describe(featureclass).OIDFieldName) to get the name of the OID field, Objectid for geodatabases, FID for shapefiles - makes the code more flexible. Also output = os.path.join(outpath,featureclass) instead of simple concatenation is good practice, it automatically inserts os.sep between the strings.
– Michael Stimson
7 mins ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
user139485 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316947%2farcpy-select-analysis-where-clause-objectid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
user139485 is a new contributor. Be nice, and check out our Code of Conduct.
user139485 is a new contributor. Be nice, and check out our Code of Conduct.
user139485 is a new contributor. Be nice, and check out our Code of Conduct.
user139485 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316947%2farcpy-select-analysis-where-clause-objectid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You're testing objectid (Long Integer) with a string, query = 'objectid < 121' will do the job. Better still query = '{} < 121'.format(arcpy.Describe(featureclass).OIDFieldName) to get the name of the OID field, Objectid for geodatabases, FID for shapefiles - makes the code more flexible. Also output = os.path.join(outpath,featureclass) instead of simple concatenation is good practice, it automatically inserts os.sep between the strings.
– Michael Stimson
7 mins ago