Query against a Geodatabase object

3058
3
08-23-2015 05:37 AM
ChristophSpoerri
New Contributor III

We are rewriting some existing ArcObject code for ArcGIS Pro. We have now some code which uses a IQueryDef to run some select statement against a IWorkspace object.

The code looks something link this:

var queryDef = workspace.CreateQueryDef();

queryDef.Tables = "mytable";

queryDef.SubFields = "name, value1, value2";

queryDef.WhereClause = "refId in (1,2,3)";

queryDef.PostfixClause = " order by value1";

var cursor = queryDef.Evaluate();

I was now wondering, how we can achive the same with the ArcGIS Pro SDK.

Thanks, Chris

0 Kudos
3 Replies
SreevatsaSreeraman
New Contributor II

Hi Christoph,

We do not have support for QueryDefs yet. But the above can be achieved using the QueryFilter and Search on the corresponding table (as long as Joins or Aggregates are not involved).

Please see ProConcepts Geodatabase · Esri/arcgis-pro-sdk Wiki · GitHub for an example.

Thanks,

Sree

ChristophSpoerri
New Contributor III

Hi Sree,

thanks for the info. I'll "solve" the problem temporarily with the QueryFilter.

Do you know, by when you think the support for QueryDefs will come?

Thanks,

Chris

0 Kudos
SreevatsaSreeraman
New Contributor II

Hi Chris,

We have it in our backlog as one of the high(er) priority items and looking to include it in a future release.

This might not be too helpful, but there it is.

Thanks,

Sree