当我尝试运行此语句时,Oracle不断收到此错误。我不确定格式错误来自哪里。也许有人用新鲜的眼睛可以帮助我解决这个问题。SQL错误:ORA-01861:文字不匹配格式字符串
INSERT INTO Faculty
(FacNo, FacFirstName, FacLastName, FacCity, FacState,
FacDept, FacRank, FacSalary, FacSupervisor, FacHireDate, FacZipCode)
VALUES ('543-21-0987','VICTORIA','EMMANUEL','BOTHELL','WA','MS','PROF',120000.0,'','2001-04-15','98011-2242');
以下是错误消息我不断收到:
Error starting at line : 1 in command - 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.
下面是桌子上的规格我试图此数据插入到:最有可能
FACNO CHAR(11 BYTE)
FACFIRSTNAME VARCHAR2(30 BYTE)
FACLASTNAME VARCHAR2(30 BYTE)
FACCITY VARCHAR2(30 BYTE)
FACSTATE CHAR(2 BYTE)
FACZIPCODE CHAR(10 BYTE)
FACRANK CHAR(4 BYTE)
FACHIREDATE DATE
FACSALARY NUMBER(10,2)
FACSUPERVISOR CHAR(11 BYTE)
FACDEPT CHAR(6 BYTE)
也许这个链接将帮助:http://stackoverflow.com/questions/22542882/sql-error-ora-01861-literal-does-not-match-format-string-01861 –
使用'to_date()'与格式掩码或ANSI日期文字:'date'2001-04-15''。详细信息在手册中:https://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements003.htm#SQLRF51062 –
to_date('2001-04-15','yyyy-mm-dd') –