DB2®ResultSet.GetOrdinal Method

Gets the column ordinal, given the name of the column.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
Public Function GetOrdinal( _
   ByVal value As String _
) As Integer
[C#]
public int GetOrdinal(
   string value
);
[C++]
public: int GetOrdinal(
   String* value
);
[JScript]
public function GetOrdinal(
   value : String
) : int;

Parameters

value
The name of the column.

Return value

The zero-based column ordinal.

Remarks

GetOrdinal performs a case-sensitive lookup first. If it fails, a second case-insensitive search is made.

GetOrdinal is kana-width insensitive.

Because ordinal-based lookups are more efficient than named lookups, it is inefficient to call GetOrdinal within a loop. Instead, call GetOrdinal once and then assign the results to an integer variable for use within the loop.