首先在数据库后台创建两个过程,主要是用来往clob里面清除,添加内容
createorreplaceprocedureClearArticleClob(SerialNumbernumber)is
--功能说明:将clob字段的内容清空
--参数说明:
--SerialNumber:序号
begin
updatewww_articletsett.areticecontent=empty_clob()whereARTICLEID=SerialNumber;
commit;
endClearArticleClob;
createorreplaceprocedurewriteArticleClob(concentvarchar2,serialNumbernumber)is
--将字符串保存到clob类型的字段里面去
--参数说明:
--concent:文章内容
--serialNumber:文章序号
v_buffvarchar2(4000);
v_clobclob;
v_amtBINARY_INTEGER;
begin
v_buff:=concent;
v_amt:=length(v_buff);
selectARETICECONTENTintov_clobfromwww_articlewhereARTICLEID=serialNumberforupdate;
dbms_lob.writeappend(v_clob,v_amt,v_buff);
commit;
endwriteArticleClob;
其中将上面的表名和字段替换成自己的就可以了。
在asp里面写如下代码就去读取内容,然后把内容通过执行后台的过程把内容写进去。
表单:areticeContent项(也就是clob字段的内容)
ForconcentILoop=1ToRequest.Form("areticeContent").Count
areticeContent=Request.Form("areticeContent")(concentILoop)
dimcontentLen,midLoop,lloop,currentContent,startPosion
areticeContent=replace(areticeContent,"'","''")
'去掉多余的换行
areticeContent=replace(areticeContent,"<p> </p>","")
areticeContent=replace(areticeContent," "," ")
contentLen=len(areticeContent)
ifconcentILoop=1then
conn.execute"ClearArticleClob("&articleID&")"
endif
ifcontentLen>1999then
ifcontentLenmod2000=0then
midLoop=contentLen/2000
else
midLoop=Int(contentLen/2000)+1
endif
startPosion=1
forlloop=1tomidLoop
currentContent=mid(areticeContent,startPosion,2000)
conn.execute"writeArticleClob('"¤tContent&"',"&articleID&")"
startPosion=startPosion+2000
next
else
conn.execute"writeArticleClob('"&areticeContent&"',"&articleID&")"
endif
next
简单的说其实就是把一篇文章分成几块保存进去。
分享到:
相关推荐
ORACLE中CLOB字段转String类型
JDBC读写Oracle的CLOB字段
asp.net操作oracle clob字段demo
把oracle数据库中字段类型为clob的字段值以字符串的形式读取出来
java操作oracle clob,基础教程,教你clob在java中的用法,简单易学。
sql server中的image类型的数据导出到oracle的clob字段中
CLOB字段处理 对CLOB进行存取的例子
最近在用oracle的过程中用到了对blob字段模糊查询的问题。接下来通过本文给大家分享关于oracle中clob字段查询慢的问题及解决方法,需要的的朋友参考下吧
CLOB字段类型报错 ORA-01704:文字字符串过长的解决
本文讲解Oracle如何对CLOB行字段来执行全文检索。
J2EE开发中,经常会遇到存储大文本的文字信息,而oracle数据库的vachar字段最大能存储4000个字节,存储更大的信息必须使用clob或blob字段,本文档就是针对j2ee开发中对colb字段操作的实现。
数据库中clob类型转换的问题 数据库中clob类型转换的问题
运用Java如何存取Oracle中的CLOB类型字段
Oracle如何插入CLOB字段值,附件为简单的示例代码。Oracle如何插入CLOB字段值,附件为简单的示例代码。
Oracle导出Clob,Blob等大字段工具,自己写的工具,方便大家下载使用
java读取oracle数据库中clob字段 把oracle数据库中字段类型为clob的字段值以字符串的形式读取出来
Oracle slq bolb转换Base64 CLOB
Oracle导出Clob,Blob工具 ,支持导出CLob工具版本2,解决上个版本导出时间有问题的bug