【发布时间】:2014-12-15 07:56:51
【问题描述】:
我的数据库表中有一个类型和大小为 VARCHAR2 的列。我在我的 CPP 代码中使用 getBlob() 方法来获取值。我面临以下异常。
例外:
ORA-01460:请求的转换未实现或不合理
@line 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 ();
}
请让我知道您的 cmets。谢谢。
PS:我检查了论坛并得到了同样异常的帖子,但找不到与我所面对的内容相关的内容。
【问题讨论】:
-
我也查了 StackOverflow,发现了 37 篇类似的帖子,你一一查了吗?
-
是的,我检查了每一个。