Hello DevArt,
I would like to migrate legacy app to UniDAC with ODBC provider. I have couple of questions.
Is there any ODBC Data Mapping documentation? What is the default mapping?
Can I map ODBC SQL_TYPE_TIMESTAMP = 93 data type to string field when using TUniQuery for example?
Maybe there is some unit with ODBC constants like UniDAC has for Oracle Data Types?
---
UniConnection.DataTypeMap.Clear;
UniConnection.DataTypeMap.AddDBTypeRule(oraVarchar2, ftString);
UniConnection.DataTypeMap.AddDBTypeRule(oraNVarchar2, ftWideString);
---
Thank you.
ODBC Data Type Mapping
Re: ODBC Data Type Mapping
DataTypeMapping is available when working with ODBCUniProvider. The following code sample illustrates the use of DataTypeMapping:
Code: Select all
uses ODBCDataTypeMapUni;
...
UniQuery.DataTypeMap.AddDBTypeRule(odbcTimeStamp, ftString);
UniQuery.Open;
...
Re: ODBC Data Type Mapping
MaximG,
Thank you for the example.
Can you give a complete list of ODBC data type constants with their values? The UniDAC version we currently use, unfortunately, is without source code and documentation doesn't contain this info.
Can you also clarify the default mapping of data types?
Thank you for the example.
Can you give a complete list of ODBC data type constants with their values? The UniDAC version we currently use, unfortunately, is without source code and documentation doesn't contain this info.
Can you also clarify the default mapping of data types?
Re: ODBC Data Type Mapping
When working with DataTypeMap using ODBCUniProvider, you can use the following ODBC types:
odbcChar
odbcWideChar
odbcVarChar
odbcWideVarChar
odbcLongVarChar
odbcWideLongVarChar
odbcSmallInt
odbcTinyInt
odbcInteger
odbcBigInt
odbcDecimal
odbcFloat
odbcDouble
odbcReal
odbcNumeric
odbcDate
odbcTime
odbcTimeStamp
odbcBit
odbcBinary
odbcVarBinary
odbcLongVarBinary
odbcBlob
odbcClob
odbcXml
odbcVariant
odbcUTinyInt
odbcUSmallInt
odbcUInteger
odbcUBigInt
We'll add the needed description to our product's documentation.
odbcChar
odbcWideChar
odbcVarChar
odbcWideVarChar
odbcLongVarChar
odbcWideLongVarChar
odbcSmallInt
odbcTinyInt
odbcInteger
odbcBigInt
odbcDecimal
odbcFloat
odbcDouble
odbcReal
odbcNumeric
odbcDate
odbcTime
odbcTimeStamp
odbcBit
odbcBinary
odbcVarBinary
odbcLongVarBinary
odbcBlob
odbcClob
odbcXml
odbcVariant
odbcUTinyInt
odbcUSmallInt
odbcUInteger
odbcUBigInt
We'll add the needed description to our product's documentation.
Re: ODBC Data Type Mapping
MaximG,
Good news. Thank you.
Good news. Thank you.