开发者

how to get TIMESTAMP column from Oracle DB into C++ (MFC or WIN32)?

开发者 https://www.devze.com 2022-12-14 11:09 出处:网络
I need to get value of column (TIMESTAMP) from oracle DB into C++. Then which dataype i should map to access database field (In MFC or WinAPI any) or what should in do to do this in proper manner.

I need to get value of column (TIMESTAMP) from oracle DB into C++. Then which dataype i should map to access database field (In MFC or WinAPI any) or what should in do to do this in proper manner.

Thanks, Anuj Seharavat

edit

Additional info: I need to fetch data from database. I am using CRecordset class and function RFX_Date is used there in DoFieldExchange(). RFX_Date has three forms (using CTime, TIMESTAMP_STRUCT and COleDateTime). Using Oracle at backend. I tried all thr开发者_JS百科ee versions but not getting the values from database.

NB: additional info extracted from OP comment to response.


You could read the timestamp into a time type:

std::istringstream i( timestamp_string );
std::time_t t;
i >> t;

Take a look at the ctime header for a description on time_t if you need it.

0

精彩评论

暂无评论...
验证码 换一张
取 消