ADO.NET data types
This table details the mapping between Vertica data types and .NET and ADO.NET data types.
.NET Framework Type | ADO.NET DbType | VerticaType | Vertica Data Type | VerticaDataReader getter |
---|---|---|---|---|
Boolean | Boolean | Bit | Boolean | GetBoolean() |
byte[] | Binary |
Binary VarBinary LongVarBinary |
Binary VarBinary LongVarBinary |
GetBytes() NoteThe limit for LongVarBinary is 32 Million bytes. If you attempt to insert more than the limit during a batch transfer for any one row, then they entire batch fails. Verify the size of the data before attempting to insert a LongVarBinary during a batch. |
Datetime | DateTime |
Date Time TimeStamp |
Date Time TimeStamp |
GetDateTime() NoteThe Time portion of the DateTime object for vertica dates is set to DateTime.MinValue. Previously, VerticaType.DateTime was used for all date/time types. VerticaType.DateTime still exists for backwards compatibility, but now there are more specific VerticaTypes for each type. |
DateTimeOffset | DateTimeOffset |
TimestampTZ TimeTZ |
TimestampTZ TimeTZ |
GetDateTimeOffset() NoteThe Date portion of the DateTime is set to DateTime.MinValue |
Decimal | Decimal | Numeric | Numeric | GetDecimal() |
Double | Double | Double |
Double Precision |
GetDouble() NoteVertica Double type uses a default precision of 53. |
Int64 | Int64 | BigInt | Integer | GetInt64() |
TimeSpan | Object | 13 Interval Types | 13 Interval Types |
GetInterval() NoteThere are 13 VerticaType values for the 13 types of intervals. The specific VerticaType used determines the conversion rules that the driver applies. Year/Month intervals represented as 365/30 days |
String | String |
Varchar LongVarChar |
Varchar LongVarChar |
GetString() |
String | StringFixedLengt | Char | Char | GetString() |
Guid | Guid | UUID (see note below) | UUID | GetGuid() |
Object | Object | N/A | N/A | GetValue() |
UUID backwards compatibility
Vertica version 9.0.0 introduced the UUID data type, including JDBC support for UUIDs. The Vertica ADO.NET, ODBC, and OLE DB clients added full support for UUIDs in version 9.0.1. Vertica maintains backwards compatibility with older supported client driver versions that do not support the UUID data type, as follows:
When an older client... | Vertica... |
---|---|
Queries tables with UUID columns | Translates the native UUID values to CHAR values. |
Inserts data into a UUID column | Converts the CHAR value sent by the client into a native UUID value. |
Queries a UUID column's metadata | Reports its data type as CHAR. |