com.esri.arcgis.geodatabase
Interface IQueryDef

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
IQueryDefProxy, QueryDef

public interface IQueryDef
extends java.io.Serializable

Provides access to members that control attribute based queries.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Description

IQueryDef sets the parameters needed to create an attribute query. The name of the table and a string defining the where clause are required. An optional list of columns may be included to specify the columns to be retrieved. If no columns are specified, all columns will be returned.

IQueryDef only can be used with ArcSDE, Personal and File Geodatabase data sources.

Remarks

The IQueryDef interface allows the definition of an attribute query based on one or more tables. Multiple table joins may be defined through the use of this interface.   

In order to access the geometry of a feature returned by the query the shape field must be included in the SubFields definition.

See Also:
IQueryFilter

Method Summary
 ICursor evaluate()
          Evaluate the query and return a cursor on the result set.
 java.lang.String getSubFields()
          The comma delimited list of field names for the query.
 java.lang.String getTables()
          The comma delimited list of table names for the query.
 java.lang.String getWhereClause()
          The where clause for the query.
 void setSubFields(java.lang.String subFields)
          The comma delimited list of field names for the query.
 void setTables(java.lang.String tables)
          The comma delimited list of table names for the query.
 void setWhereClause(java.lang.String whereClause)
          The where clause for the query.
 

Method Detail

getTables

public java.lang.String getTables()
                           throws java.io.IOException,
                                  AutomationException
The comma delimited list of table names for the query.

Supported Platforms

Windows, Solaris, Linux

Description

Get or put a comma delimited string of tables for use in the query from the Tables data member.

Remarks

Returns a string containing the name of a single table (or a list of table names when used in a join). When used with an ArcSDE datasource, the table name will be prefixed with the owner name (owner.mytable) if the table is not owned by the current workspace.

Returns:
The tables
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTables

public void setTables(java.lang.String tables)
               throws java.io.IOException,
                      AutomationException
The comma delimited list of table names for the query.

Supported Platforms

Windows, Solaris, Linux

Parameters:
tables - The tables (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubFields

public java.lang.String getSubFields()
                              throws java.io.IOException,
                                     AutomationException
The comma delimited list of field names for the query.

Supported Platforms

Windows, Solaris, Linux

Description

SubFields returns or sets a comma delimited list of fields.

Remarks

The following formats are used for the SubFields property of a QueryDef against an ArcSDE datasource:

Format 1: "*"
This returns all fields on all tables. If duplicate column names are found, the field names will be prefixed with the table name (table.field_name).

Format 2: "field1,field2,field3"
Returns only the fields requested. (Separate field names by commas but do not add a space after or before the comma)

Format 3: "table1.*,table2.field1,table3.field2"
Returns all of the fields from table1, field1 from table2 and field 2 from table3.

Returns:
The subFields
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSubFields

public void setSubFields(java.lang.String subFields)
                  throws java.io.IOException,
                         AutomationException
The comma delimited list of field names for the query.

Supported Platforms

Windows, Solaris, Linux

Parameters:
subFields - The subFields (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getWhereClause

public java.lang.String getWhereClause()
                                throws java.io.IOException,
                                       AutomationException
The where clause for the query.

Supported Platforms

Windows, Solaris, Linux

Returns:
The whereClause
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setWhereClause

public void setWhereClause(java.lang.String whereClause)
                    throws java.io.IOException,
                           AutomationException
The where clause for the query.

Supported Platforms

Windows, Solaris, Linux

Parameters:
whereClause - The whereClause (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

evaluate

public ICursor evaluate()
                 throws java.io.IOException,
                        AutomationException
Evaluate the query and return a cursor on the result set.

Supported Platforms

Windows, Solaris, Linux

Remarks

The IQueryDef interface is used to set up and define the query and also provides an Evaluate method that is used to execute the query, returning a cursor.

Returns:
A reference to a com.esri.arcgis.geodatabase.ICursor
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.