正在获取VARCHAR2类型列:ORA-01460:未实现或请求不合理的转换
Getting a VARCHAR2 type column: ORA-01460: unimplemented or unreasonable conversion requested
我有一个类型和大小为VARCHAR2<50>在我的数据库表中。我在CPP代码中使用getBlob()方法来获取值。我面临的例外如下。
异常:
ORA-01460:未实施或不合理的转换请求
@行Blob Blob=rset->getBlob(1);
代码:
if(rset->next())
{
Blob blob = rset->getBlob(1);
if(blob.isNull())
cout << "Null Blob" << endl;
else
{
blob.open (OCCI_LOB_READONLY);
int blobLength=blob.length();
Stream *instream = blob.getStream (1,0);
char *buffer = new char[blobLength];
memset (buffer, NULL, blobLength);
instream->readBuffer (buffer, blobLength);
for (int i = 0; i < size; ++i)
cout << (int) buffer[i];
cout << endl;
delete (buffer);
blob.closeStream (instream);
}
blob.close ();
}
请告诉我你的意见。谢谢
附言:我已经查看了论坛,收到了同样的帖子,但没有发现与我所面临的相关。
修改查询以使用utl_raw.cast_to_raw(col1)
,而不是简单地返回列。
尽管我想知道您是否最好使用普通的旧VARCHAR2,而不是像BLOB一样处理它。
相关文章:
- 如果没有malloc,链表实现将失败
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- 如何在c++中实现处理器调度模拟器
- 如何在c++中使用引用实现类似python的行为
- 实现无开销push_back的最佳方法是什么
- 使用简单类型列表实现的指数编译时间.为什么
- 如何在BST的这个简单递归实现中消除警告
- 如何在boost beast http请求中设置http头
- 发送一个带有libcurl C++问题的帖子请求:s
- 实现一个在集合上迭代的模板函数
- 我应该实现右值推送功能吗?我应该使用std::move吗
- 如何使用 WT 实现 AJAX 请求处理
- 服务器在实现 POST 请求时响应字符串不完整
- 如何使用套接字实现服务器客户端编程,在套接字中服务器向客户端发送消息而不从客户端获取请求
- ZeroMQ基本请求回复实现
- 如何实现消费者生产者,消费者可以请求新的数据
- C/C++ - 为 PUT 请求实现 http 协议
- 正在获取VARCHAR2类型列:ORA-01460:未实现或请求不合理的转换
- 如何在一个套接字上实现并行请求和响应的非阻塞客户端-服务器通信模型,而不存在数据竞争
- 如何实现没有陷阱的简单请求-响应技术