CREATE TABLE pledge
(
pledge_ID NUMBER NOT NULL ,
pledge_endDate DATE NULL ,
pledge_startDate DATE NULL ,
pledge_amount DECIMAL(9,2) NULL CONSTRAINT Currency_1322638346 CHECK (pledge_amount >= 0),
artist_userID NUMBER NOT NULL,
follower_userID NUMBER NOT NULL,
CONSTRAINT XPKPledge PRIMARY KEY (pledge_ID),
CONSTRAINT gets FOREIGN KEY (artist_userID) REFERENCES ArtistMember (user_ID),
CONSTRAINT makes FOREIGN KEY (follower_userID) REFERENCES FollowerMember (user_ID)
);
當我嘗試插入空值時,出現下面的錯誤。如何在日期字段中插入空值Oracle SQL Developer
INSERT INTO pledge VALUES(559, 'null','1-FEB-2016', 3850, 85275, 88128);
Error report -
SQL Error: ORA-00904: : invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error starting at line : 209 in command -
INSERT INTO pledge VALUES(559, 'NULL','1-FEB-2016', 3850, 85275, 88128)
Error at Command Line : 209 Column : 13
Error report -
SQL Error: ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
再次查看錯誤。 'insert'正在獲得ORA-00942。 ORA-00904來自'create table'。首先解決它。當你想要插入null時,它應該只是'null',而不是'null' - 這是一個字符串字面值,而不是null。不要像隱含日期轉換那樣依賴於開始日期。 –