insert into testdb values(:1,to_date(:2,'yyyymmdd'))

解决方案 »

  1.   

    要保证接受的字符串格式与格式串一致,如
    to_date('2003-01-01','YYYY-MM-DD');
      

  2.   

    问题出在:2 :2 是一个字符串,它的格式必须是,YYYYMMDD,否则ORACLE无法识别.
      

  3.   

    ORA-01861 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 white space). If the "FX" modifier has been toggled on, the literal must match exactly, with no extra white space.Action: Correct the format string to match the literal.