on 09-11-2008 12:20 PM
Hi,
May be this is question is little too specific and the information provided here is not complete. Still please try and see if the question makes sense.
My application's internal data types are mapped to data types supported by different databases as per the information given below:
Based on this information i am trying to map the application data types to MaxDB data types and have given the mapping as given below.
Please correct me if you feel any of the mapping may not be correct.
Way to read the info is on the left hand side is the application data type and the right hand side in quote is database specific type.
MySQL
=====
COLUMNTYPE_BINARYSTRING = _T("VARBINARY");
COLUMNTYPE_LONG = _T("INT");
COLUMNTYPE_DOUBLE = _T("DOUBLE");
COLUMNTYPE_CHARSTRING = _T("VARCHAR");
COLUMNTYPE_DATETIME = _T("DATETIME");
COLUMNTYPE_BLOB = _T("LONGBLOB");
COLUMNTYPE_CLOB = _T("LONGTEXT");
Oracle
======
COLUMNTYPE_LONG = _T("NUMBER"); // NUMBER(38) == INTEGER
COLUMNTYPE_DOUBLE = _T("FLOAT");
COLUMNTYPE_STRING = _T("VARCHAR2");
COLUMNTYPE_DATETIME = _T("DATE");
COLUMNTYPE_BLOB = _T("BLOB");
COLUMNTYPE_CLOB = _T("CLOB");
DB2
====
COLUMNTYPE_BINARYSTRING_BEFOREWIDTH = _T("VARCHAR");
COLUMNTYPE_BINARYSTRING_AFTERWIDTH = _T("FOR BIT DATA");
COLUMNTYPE_LONG = _T("INTEGER");
COLUMNTYPE_DOUBLE = _T("DOUBLE");
COLUMNTYPE_CHARSTRING = _T("VARCHAR");
COLUMNTYPE_DATETIME = _T("TIMESTAMP");
COLUMNTYPE_BLOB = _T("BLOB");
COLUMNTYPE_CLOB = _T("CLOB");
SYBASE
=======
COLUMNTYPE_BINARYSTRING = _T("VARBINARY");
COLUMNTYPE_LONG = _T("INT");
COLUMNTYPE_DOUBLE = _T("FLOAT");
COLUMNTYPE_CHARSTRING = _T("VARCHAR");
COLUMNTYPE_WCHARSTRING = _T("UNIVARCHAR");
COLUMNTYPE_DATETIME = _T("DATETIME");
COLUMNTYPE_BLOB = _T("IMAGE");
COLUMNTYPE_CLOB = _T("TEXT");
Based on this info i am chosing the following datatypes from MaxDB for the application internal types.
COLUMNTYPE_LONG = _T("INTEGER")
COLUMNTYPE_DOUBLE = _T("FLOAT");
COLUMNTYPE_CHARSTRING = _T("CHAR");
COLUMNTYPE_DATETIME = _T("DATE"); // Should i chose TIMESTAMP or TIME instead ?
COLUMNTYPE_BLOB = _T("BLOB");
COLUMNTYPE_CLOB = _T("CLOB");
Regards
Raja
> COLUMNTYPE_LONG = _T("INTEGER")
> COLUMNTYPE_DOUBLE = _T("FLOAT");
> COLUMNTYPE_CHARSTRING = _T("CHAR");
> COLUMNTYPE_DATETIME = _T("DATE"); // Should i chose TIMESTAMP or TIME instead ?
> COLUMNTYPE_BLOB = _T("BLOB");
> COLUMNTYPE_CLOB = _T("CLOB");
Hi there,
this looks Ok so far.
What exactly do you want to store into your DATETIME field?
regards,
Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After studying what is offered by all other db's for their below mentioned date and time field i came to the conclusion that MaxDB requires TIMESTAMP field to store the same value and not DATE field as decided earlier.
MySQL
COLUMNTYPE_DATETIME = _T("DATETIME");
Oracle
COLUMNTYPE_DATETIME = _T("DATE");
DB2
COLUMNTYPE_DATETIME = _T("TIMESTAMP");
SYBASE
COLUMNTYPE_DATETIME = _T("DATETIME");
Regards
Raja
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.