<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to use FeatureQueryName / IQueryName if I include spatial column in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/unable-to-use-featurequeryname-iqueryname-if-i/m-p/383916#M10166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have 2 oracle tables, one is a polyline featureclass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here's the code i'm using &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; 
IQueryDef queryDef = this.Workspace.CreateQueryDef() as IQueryDef;
queryDef.Tables = "EDGEADM.EAM_LOCATION_TEMP,EDGEADM.VALVESECTION";
 queryDef.SubFields = "EDGEADM.VALVESECTION.LINEGEOM, EDGEADM.EAM_LOCATION_TEMP.FUNCTLOCATION, EDGEADM.VALVESECTION.LABEL, EDGEADM.EAM_LOCATION_TEMP.MATCHTXT, EDGEADM.VALVESECTION.ID";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //queryDef.SubFields = "*";

queryDef.WhereClause = @"Replace(EDGEADM.VALVESECTION.LABEL,'/','_') = EDGEADM.EAM_LOCATION_TEMP.MATCHTXT and (STATE = 'Idle' or state = 'As-Built' or state = 'In-Service')";

IQueryName2 queryName = (IQueryName2)new FeatureQueryName();

queryName.QueryDef = queryDef;
queryName.CopyLocally = false;
 //queryName.PrimaryKey = "ID";

IWorkspaceName wsname = (this.Workspace as IDataset).FullName as IWorkspaceName;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
IDatasetName dsname = queryName as IDatasetName;
dsname.WorkspaceName = wsname;
dsname.Name = "ValveEamJoin";

IFeatureClass joinedFc = (dsname as IName).Open() as IFeatureClass;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if I leave out the LINEGEOM column, this works fine and I can use Evaluate and&amp;nbsp; get an ICursor just fine.&amp;nbsp; However, I require the shapes b/c i'm going to be buffering the results so I tried to go for the FeatureQueryName object. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I include the LINEGEOM (or "*" for subfields) column, I can create the FeatureQueryName and the corresponding FeatureClass object fine and it returns the correct number of records in the FeatureCount property but doesn't return any records using Search.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For now i am going to use GetFeature using the QueryDef.Evaluate() cursor but this is not preferred and is much slower than the way I can do this manually in arcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for any help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;kyle&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;p.s.&amp;nbsp; I suspect it may have something to do with the fact these were oracle spatial tables prior to being registered with SDE.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Oct 2013 13:29:46 GMT</pubDate>
    <dc:creator>kyleknoche</dc:creator>
    <dc:date>2013-10-23T13:29:46Z</dc:date>
    <item>
      <title>Unable to use FeatureQueryName / IQueryName if I include spatial column</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/unable-to-use-featurequeryname-iqueryname-if-i/m-p/383916#M10166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have 2 oracle tables, one is a polyline featureclass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here's the code i'm using &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; 
IQueryDef queryDef = this.Workspace.CreateQueryDef() as IQueryDef;
queryDef.Tables = "EDGEADM.EAM_LOCATION_TEMP,EDGEADM.VALVESECTION";
 queryDef.SubFields = "EDGEADM.VALVESECTION.LINEGEOM, EDGEADM.EAM_LOCATION_TEMP.FUNCTLOCATION, EDGEADM.VALVESECTION.LABEL, EDGEADM.EAM_LOCATION_TEMP.MATCHTXT, EDGEADM.VALVESECTION.ID";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //queryDef.SubFields = "*";

queryDef.WhereClause = @"Replace(EDGEADM.VALVESECTION.LABEL,'/','_') = EDGEADM.EAM_LOCATION_TEMP.MATCHTXT and (STATE = 'Idle' or state = 'As-Built' or state = 'In-Service')";

IQueryName2 queryName = (IQueryName2)new FeatureQueryName();

queryName.QueryDef = queryDef;
queryName.CopyLocally = false;
 //queryName.PrimaryKey = "ID";

IWorkspaceName wsname = (this.Workspace as IDataset).FullName as IWorkspaceName;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
IDatasetName dsname = queryName as IDatasetName;
dsname.WorkspaceName = wsname;
dsname.Name = "ValveEamJoin";

IFeatureClass joinedFc = (dsname as IName).Open() as IFeatureClass;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if I leave out the LINEGEOM column, this works fine and I can use Evaluate and&amp;nbsp; get an ICursor just fine.&amp;nbsp; However, I require the shapes b/c i'm going to be buffering the results so I tried to go for the FeatureQueryName object. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I include the LINEGEOM (or "*" for subfields) column, I can create the FeatureQueryName and the corresponding FeatureClass object fine and it returns the correct number of records in the FeatureCount property but doesn't return any records using Search.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For now i am going to use GetFeature using the QueryDef.Evaluate() cursor but this is not preferred and is much slower than the way I can do this manually in arcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for any help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;kyle&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;p.s.&amp;nbsp; I suspect it may have something to do with the fact these were oracle spatial tables prior to being registered with SDE.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 13:29:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/unable-to-use-featurequeryname-iqueryname-if-i/m-p/383916#M10166</guid>
      <dc:creator>kyleknoche</dc:creator>
      <dc:date>2013-10-23T13:29:46Z</dc:date>
    </item>
  </channel>
</rss>

