1.使用doa组件。
2.表有二个字段:id number(10),myclob clob
3.创建包mypackage,创建setAddRecord函数,往表中添加记录。成功返回1,否则返回0。4.在Delphi中声明
var
myclobstr: String;
begin
myclobstr := '......';
//显示结果,字符串长度为42425,长度有四万多啊。
showMessage(IntToStr(Length(myclobstr)));end;5.写数据库
使用OraclePackage1.CallIntegerFunction('setAddRecord',[1,myclobstr])出现了问题,不是数据不能写到数据库,而是myclobstr这个变量值写到数据库后,用dbms_output.put_line(Length(myclob)),显示出长度始终最大才4000,绝对没有超过4000长度了的,我的本意是myclobstr的值全部存储到myclob字段中,请问如果解决这个问题,谢谢!
2.表有二个字段:id number(10),myclob clob
3.创建包mypackage,创建setAddRecord函数,往表中添加记录。成功返回1,否则返回0。4.在Delphi中声明
var
myclobstr: String;
begin
myclobstr := '......';
//显示结果,字符串长度为42425,长度有四万多啊。
showMessage(IntToStr(Length(myclobstr)));end;5.写数据库
使用OraclePackage1.CallIntegerFunction('setAddRecord',[1,myclobstr])出现了问题,不是数据不能写到数据库,而是myclobstr这个变量值写到数据库后,用dbms_output.put_line(Length(myclob)),显示出长度始终最大才4000,绝对没有超过4000长度了的,我的本意是myclobstr的值全部存储到myclob字段中,请问如果解决这个问题,谢谢!
CLOB类型可以设置长度吗?怎么设置呢?
你要知道我的字符数不会低于4万的。to pingshx()
请问Varchar2怎么使用?
我知道不用设置CLOB的长度,但是你知道我这个问题出在哪儿吗?
时,如果是插入string,则正常,但是数据库中是乱码,如果插入unicode时,当
unicode长度小时,没有问题,数据库中文也是正常的,但是unicode较大时,报错
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: unicode data too large
代码如:
import cx_Oracle
conn = cx_Oracle.connect("*****")
cursor = conn.cursor()
cursor.prepare("update pro set desc=:desc where proid='1'")
cursor.setinputsizes(desc=cx_Oracle.CLOB)
a=u'中文........'
cursor.execute(None,{'desc':a})
当a很大的时候报错 unicode data too large
如果插入的是str(a),则可以插入,但是数据库中已经成了乱码,不知道各位有没
有碰到过这个问题,怎么解决的。
不过应该不是字符集的问题。
这个clob类型是不是有啥特殊的地方啊,老出错