我已经看过关于此错误的大部分主题,但我似乎无法理解人们的意思。但这是我的代码:
create table vehicle
(
v_ID CHAR (10) not null,
v_Model VARCHAR2 (20) not null,
v_manufacterer VARCHAR2 (20) not null,
plate_number CHAR (10) not null,
arive_date DATE not null,
pickup_date DATE not null
);
这是表,它被删除/创建 我想在列中插入这些值,但它一直给我错误,我查看了所有其他解决方案,但这与我的有点不同。它可能很简单,但我是SQL的新手。
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_Date, pickup_Date) VALUES ('V100','BMW','430i','N-55530','01-02-2015','02-02-2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number. arive_Date, pickup_date) VALUES ('V102','Lexus','LS300','M-33833','11/05/2015','12/05/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V101',' Mercedes','E350','A-15553','23/04/2015','23/04/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V104','Nissan','Tiida','O-1885','31/09/2015','03/10/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V105','Renault','Duster','A-19994','15/04/2015','15/04/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V106','GMC','Denali','O-60635','22/02/2015','23/02/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V107','Ford','Explorer','N-51951','11/08/2015','11/08/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V108','Ford','Mustang','G-33099','28/11/2015','29/11/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V109','Jeep','Wrangler','O-99199','22/09/2015','24/09/2015');
INSERT INTO vehicle (V_ID, V_Model, V_manufacterer, plate_number, arive_date, pickup_date) VALUES ('V110','Dodge','Charger','E-1370','14/04/2015','14/04/2015');
我尝试将格式更改为每个可能的选项:
04/14/2015 or 2015/04/14 - 2015/14/04 or even Apr-14-2015.
它们似乎都不起作用。
我想要的是插入以下车辆(属于客户)的到货日期和取货日期
感谢。
答案 0 :(得分:3)
当您将日期格式化为文本时始终具体:使用正确的数据日期/时间格式明确进行转换。
to_date('14/04/2015', 'DD/MM/YYYY')
为所有日期输入执行此操作。