2013-11-14 161 views
0
CREATE TABLE dw.D_DAYLIGHT_SAVINGS 
(
    DAYLIGHT_YEAR  INTEGER NOT NULL, 
    DAYLIGHT_START  DATE, 
    DAYLIGHT_END  DATE, 
    Last_Udpated_date DATE DEFAULT SYSDATE, 
    Last_updated_user VARCHAR2 (25) DEFAULT 'DW' 
); 

表已創建,但是當我嘗試在TOAD中運行並在其中插入值錯誤彈出作爲命令未正確結束。對於插入查詢是如下試圖執行sql命令

insert into dw.D_DAYLIGHT_SAVINGS values 
(2013,'March 10','November 3'), 
(2014,'March 9','November 2'), 
(2015,'March 8','November 1'), 
(2016,'March 13','November 6'), 
(2017,'March 12','November 5'); 
+0

什麼是錯誤? –

回答

0

你必須有各行的單獨INSERT INTO聲明並添加DEFAULT的,你沒有指定每一列:

insert into dw.D_DAYLIGHT_SAVINGS values (2013,'March 10','November 3', DEFAULT, DEFAULT); 
insert into dw.D_DAYLIGHT_SAVINGS values (2014,'March 9','November 2', DEFAULT, DEFAULT); 
insert into dw.D_DAYLIGHT_SAVINGS values (2015,'March 8','November 1', DEFAULT, DEFAULT); 
insert into dw.D_DAYLIGHT_SAVINGS values (2016,'March 13','November 6', DEFAULT, DEFAULT); 
insert into dw.D_DAYLIGHT_SAVINGS values (2017,'March 12','November 5', DEFAULT, DEFAULT); 

或提供的清單入列要插入的列:

insert into dw.D_DAYLIGHT_SAVINGS (DAYLIGHT_YEAR, DAYLIGHT_START, DAYLIGHT_END) values (2013,'March 10','November 3'); 
insert into dw.D_DAYLIGHT_SAVINGS (DAYLIGHT_YEAR, DAYLIGHT_START, DAYLIGHT_END) values (2014,'March 9','November 2'); 
insert into dw.D_DAYLIGHT_SAVINGS (DAYLIGHT_YEAR, DAYLIGHT_START, DAYLIGHT_END) values (2015,'March 8','November 1'); 
insert into dw.D_DAYLIGHT_SAVINGS (DAYLIGHT_YEAR, DAYLIGHT_START, DAYLIGHT_END) values (2016,'March 13','November 6'); 
insert into dw.D_DAYLIGHT_SAVINGS (DAYLIGHT_YEAR, DAYLIGHT_START, DAYLIGHT_END) values (2017,'March 12','November 5');