DBD :: Oracle :: st执行失败:ORA-01861:literal与clob中的格式字符串不匹配

时间:2014-09-09 21:39:10

标签: sql oracle

我的SQL的另一个问题。 我将clob数据作为json字符串插入到我的表中:

Name              Null     Type         
----------------- -------- ------------ 
ID                NOT NULL NUMBER       
SAMPLENAME        NOT NULL VARCHAR2(25) 
STUDY_ID                   NUMBER       
STOCK_ID          NOT NULL NUMBER       
BARCODE                    VARCHAR2(25) 
WELL                       VARCHAR2(3)  
DATA                       CLOB         
DATE_ADDED                 DATE         
DATA_TYPE         NOT NULL VARCHAR2(1)  
IS_CURRENT        NOT NULL NUMBER       

DBD::Oracle::st execute failed: ORA-01861: literal does not match format string (DBD ERROR: error possibly near <*> indicator at char 65 in
 'insert into results values(:p1,:p2,:p3,:p4,:p5,:p6,:p7,:<*>p8,:p9,:p10)')

通过命令行运行它们会给我:

Error report -
SQL Error: ORA-01861: literal does not match format string
01861. 00000 -  "literal does not match format string"
*Cause:    Literals in the input must be the same length as literals in
           the format string (with the exception of leading whitespace).  If the
           "FX" modifier has been toggled on, the literal must match exactly,
           with no extra whitespace.
*Action:   Correct the format string to match the literal.

这是插入声明:

insert into results values(1060,'teresta1232',3149,354600,1381992393,'A01','{'data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj','data1':''fjfaskfj'}','2014-08-13T00:00:10','F',1);

1 个答案:

答案 0 :(得分:0)

问题是日期列DATE_ADDED

的值
2014-08-13T00:00:10

您没有为此日期转换指定任何格式。所以暗示oracle会尝试使用NLS_DATE_FORMAT

转换为日期

您必须明确指定日期格式,如下所示,以获得一致的结果。

TO_DATE('2014-08-13T00:00:10','YYYY-MM-DD HH24:MI:SS')