如何使用OleDb插入CLOB

时间:2022-09-27 13:30:06

Could someone post some sample code showing how to insert text greater than 4000 characters in length into an Oracle 10g CLOB field? I am using the Oracle OLEDB provider and ATL in C++. My naive attempt returns the error 'ORA-01704: string literal too long' whenever the text I am attempting to insert goes over 4000 characters in length. I'm guessing I need to parameterise the 4000+ character string somehow but I'm not sure how to do that...

有人可以发布一些示例代码,显示如何将长度超过4000个字符的文本插入到Oracle 10g CLOB字段中吗?我在C ++中使用Oracle OLEDB提供程序和ATL。每当我尝试插入的文本长度超过4000个字符时,我的天真尝试都会返回错误'ORA-01704:string literal too long'。我猜我需要以某种方式参数化4000+字符串,但我不知道该怎么做...

1 个解决方案

#1


I eventually got this working. In case anyone else has the same problem, I inserted the value EMPTY_CLOB() then used the ISequentialStream interface to stream the text into the empty field. The Microsoft mydyntext sample shows how to do this.

我最终得到了这个工作。如果其他人有同样的问题,我插入值EMPTY_CLOB()然后使用ISequentialStream接口将文本流式传输到空字段。 Microsoft mydyntext示例显示了如何执行此操作。

#1


I eventually got this working. In case anyone else has the same problem, I inserted the value EMPTY_CLOB() then used the ISequentialStream interface to stream the text into the empty field. The Microsoft mydyntext sample shows how to do this.

我最终得到了这个工作。如果其他人有同样的问题,我插入值EMPTY_CLOB()然后使用ISequentialStream接口将文本流式传输到空字段。 Microsoft mydyntext示例显示了如何执行此操作。