ArcObjects Library Reference (GeoDatabase)  

IRelQueryTableFactory.Open Method

Opens a join table specified by the given properties.

[Visual Basic .NET]
Public Function Open ( _
    ByVal RelationshipClass As IRelationshipClass, _
    ByVal joinForward As Boolean, _
    ByVal QueryFilter As IQueryFilter, _
    ByVal SrcSelectionSet As ISelectionSet, _
    ByVal TargetColumns As String, _
    ByVal DoNotPushJoinToDB As Boolean, _
    ByVal openAsLeftOuterJoin As Boolean _
) As IRelQueryTable
[C#]
public IRelQueryTable Open (
    IRelationshipClass RelationshipClass,
    bool joinForward,
    IQueryFilter QueryFilter,
    ISelectionSet SrcSelectionSet,
    string TargetColumns,
    bool DoNotPushJoinToDB,
    bool openAsLeftOuterJoin
);
[C++]
HRESULT Open(
  IRelationshipClass* RelationshipClass,
  VARIANT_BOOL joinForward,
  IQueryFilter* QueryFilter,
  ISelectionSet* SrcSelectionSet,
  BSTR TargetColumns,
  VARIANT_BOOL DoNotPushJoinToDB,
  VARIANT_BOOL openAsLeftOuterJoin,
  IRelQueryTable** Table
);
[C++]

Parameters

RelationshipClass [in]

  RelationshipClass is a parameter of type IRelationshipClass

joinForward [in]   joinForward is a parameter of type VARIANT_BOOL QueryFilter [in]

  QueryFilter is a parameter of type IQueryFilter

SrcSelectionSet [in]

  SrcSelectionSet is a parameter of type ISelectionSet

TargetColumns [in]   TargetColumns is a parameter of type BSTR DoNotPushJoinToDB [in]   DoNotPushJoinToDB is a parameter of type VARIANT_BOOL openAsLeftOuterJoin [in]   openAsLeftOuterJoin is a parameter of type VARIANT_BOOL Table [out, retval]

  Table is a parameter of type IRelQueryTable

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The Open method either creates a new RelQueryTable or returns a reference to an existing RelQueryTable if that class has already been created.

The following table further describes each parameter in the Open method:

Parameter   Meaning
RelationshipClass This is the RelationshipClass used to define the join tables and join fields as well as the cardinality.
joinForward If joinForward is True, the origin table from pRelClass is the source in the RelQeuryTable, otherwise the destination table in pRelClass becomes the source. If the cardinality is many to one, you can define your relationship as 1 to many and set this parameter to false in order to make the many side the source. You will need to do this since you can't set the cardinality to many to 1 for a RelationshipClass.
QueryFilter You can further define the data that will be returned by a RelQueryTable by applying a QueryFilter. The WhereClause of pQueryFilter is added to the WhereClause of the QueryFilter specified when you use the ITable::Search method using the and operator. The SubFields of pQueryFilter define which fields will include data when a cursor is opened. The other fields are included but will be empty.
SrcSelectionSet  This parameter is not exposed and should always be set to nothing.
TargetColumns This is a comma delimited string that defines the fields returned from the destination table. This is different from the SubFields of pQueryFilter since in this case, fields not included in target_columns are not included at all in a cursor.
DoNotPushJoinToDB  If this is True, the join is always processed on the client otherwise it is processed on the server if possible. If all tables involved are stored on the same ArcSDE server or Personal Geodatabase, the processing can be performed by the server, which is normally faster. The openAsLeftOuterJoin parameter below must also be set to False in order for processing to occur on the server. In any other case, processing occurs on the client regardless of how this parameter is set.
openAsLeftOuterJoin  A left outer join is performed if this is True, otherwise a left inner join is performed. See IRelQueryTableInfo::JoinType for more information.

 

The following diagram shows how the output RelQueryTable represents a table join.

RelQueryTable diagram

See Also

IRelQueryTableFactory Interface

.NET Related Topics

Geodatabase | Joining data