DB2ResultSet.GetDB2TimeStamp Method

Creates an instance of a DB2TimeStamp object from the column data.

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

Syntax


[Visual Basic]
Public Function GetDB2TimeStamp( _
   ByVal i As Integer _
) As IBM.Data.DB2Types.DB2TimeStamp
[C#]
public IBM.Data.DB2Types.DB2TimeStamp GetDB2TimeStamp (int i)
[C++]
public: IBM.Data.DB2Types.DB2TimeStamp GetDB2TimeStamp(
   int i
);
[JScript]
public function GetDB2TimeStamp(
   i : int
) : IBM.Data.DB2Types.DB2TimeStamp;

Parameters

i
The zero-based column ordinal.

Return value

A DB2TimeStamp object representing the column value.

Remarks

No conversions are performed. If the column is of type timestamp with timezone, the time zone value is ignored and a DB2TimeStamp object is returned.

The following table describes the mapping between the return object data type and the data server data type.
DB2®Type Data Type Db2® Data Type Informix® Data Type
DB2TimeStamp TIMESTAMP DATETIME (date and time precision)

The Informix DATETIME data type has the internal format as YYYY-MM-DD HH:MM:SS.nnnnn, whereas the DB2Type TIMESTAMP data type, has a format of YYYY-MM-DD-HH.MM.SS.nnnnnn. This difference in format in the fractional part requires a minor adjustment to match the formats. While reading from the database, a zero will be appended at the least significant digit to match six fractional digits. Similarly while writing to the database, the least significant digit in fraction will be truncated to match the Informix DATETIME type format.

Exceptions

Exception type Condition
InvalidCastException The specified cast is not valid.
DB2Exception Invalid conversion.