insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone)values(25,'David','Sell',to_date('14-JUN-2005','DD-MON-YYYY'),'M','12','01-8928-9207')ORA-01843: not a valid month报什么错误啊?
格式“DD-MM-YYYY”的可以add,但是'DD-MON-YYYY'就报错,怎么解决?

解决方案 »

  1.   

    insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone)
    values(26,'David','Sell',to_date('14-05-2008','DD-MM-YYYY'),'M','12','01-8928-9207');试下吧 。你要的是'DD-MON-YYYY'是不是 纯英文系统才可以有的字符串呢 ?这个我不敢确定,只是疑惑啦!
      

  2.   

    我查到了 :中文系统下:
    insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone)
    values(27,'David','Sell',to_date('14-6月-2008','DD-MON-YYYY'),'M','12','01-8928-9207');英文系统下:
    insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone)
    values(27,'David','Sell',to_date('14-JAN-2008','DD-MON-YYYY'),'M','12','01-8928-9207');
      

  3.   

    insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone) 
    values(27,'David','Sell',to_date('14-6月-2008','DD-MON-YYYY'),'M','12','01-8928-9207'); 
      

  4.   

    可以用
    alter session set nls_date_format = 'xxxxxxxx'
    修改日期格式
      

  5.   

    the answer is:
    alter session set nls_date_language='american';
    insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone)values(25,'David','Sell',to_date('14-JUN-2005','DD-MON-YYYY'),'M','12','01-8928-9207') 
      

  6.   

    insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone) 
    values(26,'David','Sell',to_date('14-05-2008','DD-MM-YYYY'),'M','12','01-8928-9207'); 
     
    insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone) 
    values(27,'David','Sell',to_date('14-6月-2008','DD-MON-YYYY'),'M','12','01-8928-9207'); insert into authors(author_id,first_name,last_name,birthdate,gender,nationality_id,phone) 
    values(27,'David','Sell',to_date('14-JAN-2008','DD-MON-YYYY'),'M','12','01-8928-9207'); 以上3个都可以的。