24,855
社区成员
发帖
与我相关
我的任务
分享
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;
}