Interface ITable

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll

Provides access to members that return information about and manage tables.

[Guid("FCB01CB5-9F0B-11D0-BEC7-00805F7C4268")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITable : IClass

Remarks

The ITable interface is the principal interface for working with tables. It inherits from IClass and provides additional methods that allow you to query, select, insert, update and delete rows from the table.

All modifications to rows in the table through this interface will preserve object behavior associated with the table. For example, using DeleteSearchedRows on a table that is the origin of a composite relationship will delete rows from the related object class.

Properties

CLSID

UID CLSID { get; }

Property Value

UID

EXTCLSID

UID EXTCLSID { get; }

Property Value

UID

Extension

object Extension { get; }

Property Value

object

ExtensionProperties

IPropertySet ExtensionProperties { get; }

Property Value

IPropertySet

Fields

IFields Fields { get; }

Property Value

IFields

HasOID

bool HasOID { get; }

Property Value

bool

Indexes

IIndexes Indexes { get; }

Property Value

IIndexes

OIDFieldName

string OIDFieldName { get; }

Property Value

string

Methods

AddField(IField)

void AddField(IField Field)

Parameters

Field IField

AddIndex(IIndex)

void AddIndex(IIndex Index)

Parameters

Index IIndex

CreateRow()

Creates a row in the database with a system assigned object ID and null property values.

IRow CreateRow()

Returns

IRow

Remarks

The CreateRow method creates a new row in the underlying database with a system assigned object id value. A row object representing the created row is returned to the caller. The row object returned has the system assigned object ID as the value of the OIDField. All other fields are initialized to null values if they can be made null and to built-in default values appropriate to the type of the field if they cannot be made null.

The caller is responsible for setting the desired field values into the row and calling the Store method on the row. If the table represents an object class with subtypes, then it is the caller’s responsibility to set the default subtype code into the row and call the InitDefaultValues method on the row before storing, if that is the desired result. For tables without object behavior, insert cursors offer a more efficient way for inserting new rows.

CreateRowBuffer()

Creates a row buffer that can be used with an insert cursor.

IRowBuffer CreateRowBuffer()

Returns

IRowBuffer

Remarks

The CreateRowBuffer method creates a new row buffer object in memory and returns it to the caller. No row is created in the database. The returned row buffer does not have an object ID value. The caller can set values into the row buffer and use it as an argument to the InsertRow method on an insert cursor; the latter is obtained by calling the Insert method on the Table.

DeleteField(IField)

void DeleteField(IField Field)

Parameters

Field IField

DeleteIndex(IIndex)

void DeleteIndex(IIndex Index)

Parameters

Index IIndex

DeleteSearchedRows(IQueryFilter)

Delete the Rows in the database selected by the specified query.

void DeleteSearchedRows(IQueryFilter QueryFilter)

Parameters

QueryFilter IQueryFilter

FindField(string)

int FindField(string Name)

Parameters

Name string

Returns

int

GetRow(long)

The row from the database with the specified object ID.

IRow GetRow(long OID)

Parameters

OID long

Returns

IRow

Remarks

The GetRow method returns an existing row object, given its object ID value. The caller can query the returned row object for additional object specific interfaces. The retrieved row may be modified; calling Store on the row object after changing it will trigger messages to related objects and will mark the row for committing to the database.

GetRows(object, bool)

The cursor of rows based on a set of object ids.

ICursor GetRows(object oids, bool Recycling)

Parameters

oids object
Recycling bool

Returns

ICursor

Remarks

The GetRows method returns a cursor that may be used to retrieve a set of rows specified by the input array of object id values. See the description of the Search method to understand the meaning of the recycling parameter. It is far more efficient to retrieve a set of rows using the GetRows method than it is to retrieve each individual row using the GetRow method. The retrieved rows may be modified; Store should be called on the row objects after changing them.

The oids parameter should be passed an integer array. For example:

 

[C#]

// Get a recycling cursor for the OID array.

int[] oidArray = new int[] { 10844, 10853, 10871 };

ICursor cursor = table.GetRows(oidArray, true);

Insert(bool)

Returns a cursor that can be used to insert new Rows.

ICursor Insert(bool useBuffering)

Parameters

useBuffering bool

Returns

ICursor

Remarks

The Insert method returns an insert cursor that can be used to bulk insert rows. It offers significantly faster performance than multiple calls to CreateRow and Store for tables storing simple rows and simple features (that is, for tables whose CLSID is esriGeoDatabase.Row, esriGeoDatabase.Object, or esriGeoDatabase.Feature).

Insert cursors on tables containing complex objects use the CreateRow and Store methods to achieve polymorphism, and there is no difference in performance in these cases.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

RowCount(IQueryFilter)

The number of Rows selected by the specified query.

long RowCount(IQueryFilter QueryFilter)

Parameters

QueryFilter IQueryFilter

Returns

long

Search(IQueryFilter, bool)

An object cursor that can be used to fetch row objects selected by the specified query.

ICursor Search(IQueryFilter QueryFilter, bool Recycling)

Parameters

QueryFilter IQueryFilter
Recycling bool

Returns

ICursor

Remarks

The Search method returns a search cursor that can be used to retrieve rows specified by a query filter. The recycling parameter controls row object allocation behavior. Recycling cursors rehydrate a single row object on each fetch and can be used to optimize read-only access, for example, when drawing. It is illegal to maintain a reference on a row object returned by a recycling cursor across multiple calls to NextRow on the cursor.

Row objects returned by a recycling cursor should not be modified. Non-recycling cursors return a separate row object on each fetch. The objects returned by a non-recycling cursor may be modified and stored with polymorphic behavior. The geodatabase guarantees ‘unique instance semantics’ on non-recycling row objects fetched during an edit session. If the row object to be retrieved by a call to search has already been instantiated and is being referenced by the calling application, then a reference to the existing row object is returned.

Non-recycling feature cursors returned from the Search method *MUST* be used when copying features from the cursor into an insert cursor of another class.  This is because a recycling cursor reuses the same geometry and under some circumstances all of the features inserted into the insert cursor may have the same geometry.  Using a non-recycling cursor ensures that each geometry is unique.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

Select(IQueryFilter, esriSelectionType, esriSelectionOption, IWorkspace)

A selection that contains the object ids selected by the specified query.

ISelectionSet Select(IQueryFilter QueryFilter, esriSelectionType selType, esriSelectionOption selOption, IWorkspace selectionContainer)

Parameters

QueryFilter IQueryFilter
selType esriSelectionType
selOption esriSelectionOption
selectionContainer IWorkspace

Returns

ISelectionSet

Remarks

The Select method returns a selection set that holds either row IDs or row objects from the Table depending on the selection option. Multiple selection sets can be created on the same table. It is up to a client application or object to keep a reference on created selections and use them as appropriate. For example, a FeatureLayer creates and uses selections on a FeatureClass (a type of Table).

The selType parameter determines the type of selection set that will be created: an ID set, a snapshot, or a hybrid. See the ISelectionSet interface for a comparison of the three types.

When calling Select the selectionContainer parameter is no longer required. A null value should be passed as this parameter. 

Update(IQueryFilter, bool)

Returns a cursor that can be used to update Rows selected by the specified query.

ICursor Update(IQueryFilter QueryFilter, bool Recycling)

Parameters

QueryFilter IQueryFilter
Recycling bool

Returns

ICursor

Remarks

The Update method returns an update cursor that can be used to update or delete rows. It offers somewhat faster performance than multiple calls to Store or Delete on row objects fetched using a non-recycling search cursor for tables storing simple rows and simple features. There is no difference in performance for complex objects and features.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

UpdateSearchedRows(IQueryFilter, IRowBuffer)

Update the Rows in the database selected by the specified query.

void UpdateSearchedRows(IQueryFilter QueryFilter, IRowBuffer buffer)

Parameters

QueryFilter IQueryFilter
buffer IRowBuffer