Select to view content in your preferred language

Copy an SQL list of ObjectIDs or user-defined IDs to the clipboard

576
0
12-15-2022 04:44 AM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

It would be helpful if there were an Attribute Table button or Contents Layer right-click option to do the following:

Copy an SQL list of ObjectIDs or user-defined IDs to the clipboard. For example:

OBJECTID IN (2, 4, 6, 8)
ASSET_ID IN (‘RD123’, ‘RD456’, ‘RD789’)

The tool would honour an existing selection or definition query. 

Use case: ArcGISPro is good for making selections. I want to fully utilize that functionality by:

  • Easily creating a modifiable definition query or select by attributes SQL expression.
  • Or use the selection/list in an SQL client.
  • Or documenting/emailing a list of IDs that need to be investigated. The list could be used to create a selection or definition query.
  • Lots more.

I’m aware that it’s possible to do something similar with a custom ArcPy script. Or by copying the attribute table to Excel and generating a SQL list using formulas, etc. But I think an OOTB tool would be better.

It would be comparable to when Microsoft added the Copy Path functionality in Windows Explorer to the right-click menu (works for multiple files). Previously, it was technically possible to do that manually, by using a custom script, or using Excel Power Query. But the Copy Path tool is way more convenient than those other options. The same would apply to this “Copy SQL list of IDs to clipboard” idea: an OOTB tool would be much more efficient.

Thanks.