读书人

c++报错:Input string value is too l

发布时间: 2012-03-12 12:45:33 作者: rapoo

c++报错:Input string value is too large to fit into the buffer
[DBERR 错误:Input string value is too large to fit into the buffer :
insert into temp_info (c1,c2,c3,c4,c5,c6,c7) values(:c1 ,:c2,:c3,to_date(:c4,'YYYYMMDDHH24MISS' ),:c5,:c6,:c7) : Variable: :c7<CHAR>, datatype in operator <</>>: CHAR]

数据库中针对c7是这样定义的:
create table temp_info (
c1 NUMBER(18) not null,
c2 NUMBER(5) not null,
c3 VARCHAR2(10) not null,
c4 DATE not null,
c5 VARCHAR2(20) not null,
c6 NUMBER(5) not null,
c7 VARCHAR2(2047)
)

程序插入时:
insert into temp_info (c1,c2,c3,c4,c5,c6,c7) values(:c1<LONG>,:c2<int>,:c3<char[10+1]>,to_date(:c4<char[15]>,'YYYYMMDDHH24MISS'\
),:c5<char[20+1]>,:c6<INT>,:c7<char[2047+1]>)

[解决办法]

探讨
正解。


引用:

C/C++ code

c3 VARCHAR2(10) not null //这里定义了10

c3<char[10+1]>//插入了11

读书人网 >C++

热点推荐