C++ 使用oci访问数据库出现“Column: 2<DOUBLE>, datatype in operator <</>>: CHAR”
2014-08-06 23:31
579 查看
http://bbs.csdn.net/topics/90049666
比如有表a,其中一个字段是number类型的,如果在vc中读取这个大数,用什么来读取?
vc中int 和long int都是4个字节的,根本不够用啊?
如果定义一个string s来接受这个整数的话,用otl_stream o;
o>>s;接受的时候,提示错误,因为oracle里面的number不能用string来接受,如果用int i;
o>>i;可以,但是i溢出,得到的值不正确啊,谁遇到过这样的情况,怎么解决的?
不能用char来接收number字段的内容
提示错误如下:
Column: 1<DOUBLE>, datatype in operator <</>>: CHAR
otl_long_string 只能接收oracle数据库中字段为long类型的,number类型的不能用otl_long_string来接收,如果用otl_long_string来接收的话,例如
otl_long_sring ols;
o>>ols; // o 为 otl_stream 类型
提示出错,类似和用char接收number一样的错误,
不是说了嘛
ostream::set_column_type转成字符串
读出来后,
boost::lexical_cast或者自己处理字符串都可以
哎……
比如有表a,其中一个字段是number类型的,如果在vc中读取这个大数,用什么来读取?
vc中int 和long int都是4个字节的,根本不够用啊?
如果定义一个string s来接受这个整数的话,用otl_stream o;
o>>s;接受的时候,提示错误,因为oracle里面的number不能用string来接受,如果用int i;
o>>i;可以,但是i溢出,得到的值不正确啊,谁遇到过这样的情况,怎么解决的?
不能用char来接收number字段的内容
提示错误如下:
Column: 1<DOUBLE>, datatype in operator <</>>: CHAR
otl_long_string 只能接收oracle数据库中字段为long类型的,number类型的不能用otl_long_string来接收,如果用otl_long_string来接收的话,例如
otl_long_sring ols;
o>>ols; // o 为 otl_stream 类型
提示出错,类似和用char接收number一样的错误,
不是说了嘛
ostream::set_column_type转成字符串
读出来后,
boost::lexical_cast或者自己处理字符串都可以
哎……
相关文章推荐
- C++编译出现binding ‘const string {aka const std::__cxx11::basic_string<char>}’ to reference of type ‘std
- 使用Gevent程序正常运行出现这个异常KeyError(155880780,) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored解决办法
- CoreData的简单使用<二、CoreData两张数据库表的关联操作>
- MFC使用ADO连接数据库的问题:error C2059: 语法错误 : “<L_TYPE_raw>”
- VC 使用ADO连接数据库的问题!error C2059: 语法错误 : “<L_TYPE_raw>” .
- How to convert array<System::Byte> to char* in C++ CLR?
- insert<type 'exceptions.Exception'>:(1406, "Data too long for column '' at row
- C++ vector<int>::size_type的使用
- c++11 多线程 2<<c++ concurrency in action>>
- c++11 使用c++风格的cast: static_cast<type>(expression) const_cast<type> dynamic_cast reinterpret_cast
- 此诊断出现在编译器生成的函数“CList<TYPE,ARG_TYPE> &CList<TYPE,ARG_TYPE>::operator =(const CList<TYPE,ARG_TYPE> &)”
- Entity FrameWork 中使用Expression<Func<T,true>>访问数据库性能优化
- 使用<input type="text" value=<%=str%>>出现取值不全的问题
- VC 使用ADO连接数据库的问题!error C2059: 语法错误 : “<L_TYPE_raw>”
- 使用<input type="text" value=<%=str%>>出现取值不全的问题
- 数据库组件 Hxj.Data (二十一) (ToScalar<TResult>)
- 为什么 FleaPHP 使用 Table Data Gateway 代替 Active Record 来提供数据库访问服务
- C++中使用&lt;&lt;operator 读取纪录行
- Linux下使用C/C++访问数据库――MySQL篇
- 使用lucene.net2.0 搜索数据库的例子<转自csdn>