Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODBC / MFC: Numbers are mapped to String

408848Nov 12 2003 — edited Dec 4 2003
Somebody else had a comparable problem a few months ago, but so far I found no solution.

We have fields in the database defined as number(11). When we read them via ODBC (using the latest Oracle ODBC driver) in Visual C++ 6.0 (service pack 4) with CRecordSet it is mapped to CString instead to a long.

Here a code example:

----------------------------------------------
CRecordset SzName(&DB);
CString SQLQueryText;
CDBVariant varValue;

SQLQueryText.Format("SELECT * FROM ACTION");
SzName.Open(CRecordset::forwardOnly, _T(SQLQueryText), CRecordset::readOnly);
SzName.GetFieldValue("STATE",varValue);
----------------------------------------------

STATE is defined as number(11) and varValue interprets it as a string!

Any ideas how to solve this problem?

Thank you very much for your help.

-- Frank
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2004
Added on Nov 12 2003
1 comment
345 views