c++报错:Input string value is too large to fit into the buffer

问题描述:

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,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,:c2,:c3,to_date(:c4,'YYYYMMDDHH24MISS'\
\x05\x05),:c5,:c6,:c7)

可能是 SQL绑定的变量是超过长度的吧,最后一位一定要是\0的 不然就会报这种错