Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

data type mapping from application to MaxDB

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

Former Member
replied

> 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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question