请教:oracle occi 读写clob类型数据

fibbery 2013-02-04 11:14:24
各位好:

最近需要通过occi方式,调用oracle的一个存储过程,

存储过程如下:
CREATE OR REPLACE PROCEDURE TESTCLOB 
(
PARAM1 IN NUMBER
, PARAM2 IN CLOB
) AS
BEGIN
insert into test(COLUMN1,COLUMN2) values(PARAM1,PARAM2);
NULL;
END TESTCLOB;

访问的表如下:
CREATE TABLE "TEST"
(
"COLUMN1" NUMBER,
"COLUMN2" CLOB
)

C++访问部分如下:
unsigned char str[]="1234567890";
_stmt = _conn->createStatement("begin TESTCLOB(:1,:2); end;");

Clob clobXmlInfo;
clobXmlInfo.setEmpty(_conn);
if(!clobXmlInfo.isInitialized())
{
return false;
}
clobXmlInfo.write(10,str,10);
_stmt->setClob(2,clobXmlInfo);
_stmt->setUInt(1,xmlNo);

if (_stmt != NULL)
{
_stmt->executeUpdate();
_conn->commit();
_conn->terminateStatement(_stmt);
_stmt = NULL;
}


运行后,抛出异常:
ORA-22275: invalid LOB locator specified

此处不知道该怎么解决,请高手指点!
...全文
195 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2013-02-04
  • 打赏
  • 举报
回复
cdemodr1.c,cdemodr2.c,cdemodr3.c Using INSERT/UPDATE/DELETE statements with RETURNING clause used with basic datatypes, LOBs and REFs. cdemolb.c Create and insert LOB data and then read, write, copy, append and trim the data. cdemolb2.c Writing and reading of CLOB/BLOB columns with stream mode and callback functions. cdemolbs.c Writing and reading to LOBs with the LOB buffering system. cdemol2l.c Accesses LOBs using the LONG API.

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧