我創建了一個表:的Oracle SQL:列不允許
CREATE TABLE AIRLINE (
airline_code NUMBER(4) PRIMARY KEY NOT NULL,
airline_name VARCHAR(29) NOT NULL,
airline_address1 VARCHAR(29) NOT NULL,
airline_address2 VARCHAR(29),
airline_postcode VARCHAR(29),
airline_city VARCHAR(29) NOT NULL,
airline_country VARCHAR(29) NOT NULL
);
當我插入此插入語句:
INSERT INTO AIRLINE (airline_code, airline_name, airline_address1, airline_address2, airline_postcode, airline_city, airline_country)
VALUES ("BA07", "British Airways PLC", "Waterside", "PO Box 365, Harmondsworth", "UB7 0GB", "London", "United Kingdom");
我得到不允許指向英國說「列錯誤在這裏「,據我所知,有相同數量的列數據被插入到表中。
另外,'airline_code'有'datatype'不匹配,你不能用'NUMBER'來存儲''BA07'。看到我的答案。 – 2015-02-07 11:11:09
如果有疑問,請閱讀以下手冊:https://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements003.htm#SQLRF00218和https://docs.oracle.com/cd/E11882_01/server 0.112/e41084/sql_elements008.htm#SQLRF00223 – 2015-02-07 12:04:08