gpt4 book ai didi

sql - ORA-01858 : a non-numeric character was found where a numeric was expected? 即使值是数字?

转载 作者:行者123 更新时间:2023-12-02 01:42:57 26 4
gpt4 key购买 nike

这是表格

    CREATE TABLE Employee
(EmpID number(5) primary key,
SIN Number(9) Not null,
LastName Varchar2(25) Not null,
FirstName Varchar2(25),
Street Varchar2(30),
City Varchar2(25),
Province Char(2),
PostalCode Varchar2(7),
JobCode Number(4) Not null,
Foreign Key(JobCode) REFERENCES Job,
IncomeTax Char(1),
BirthDate Date,
HireDate Date,
JobCodeDate Date)
TABLESPACE users;

这是我要插入的行,只有三个数值,据我所知,它们都是数字。

INSERT INTO Employee VALUES(97319,516303417,'Novak','Gerry','6803 Park Ave.','Moose Jaw','SK','S6H 1X7',3000,'N','24-Aug-86','07-Jul-03','07-Jul-03');

ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected

最佳答案

我认为问题出在日期列上,请尝试使用以下语法to_date('07-Jul-03','DD-MON-YY'):

INSERT INTO Employee 
VALUES(97319,516303417,'Novak','Gerry','6803 Park Ave.','Moose Jaw','SK','S6H 1X7',3000,'N',to_date('24-Aug-86', 'DD-MON-YY'),to_date('07-Jul-03','DD-MON-YY'),to_date('07-Jul-03','DD-MON-YY'));

SQL-Fiddle: http://sqlfiddle.com/#!4/0e9df/2

关于sql - ORA-01858 : a non-numeric character was found where a numeric was expected? 即使值是数字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22393536/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com