2

当我写这篇文章时,我收到错误“ORA-00911:无效字符”,我看不到这个字符。代码工作正常,直到 ALTER TABLE,这就是这个字符所在的位置。

    CREATE TABLE tbl_orders
    (Order_ID NUMBER NOT NULL,
    Customer_ID NUMBER NOT NULL,
    Order_Date DATE NOT NULL,
    Order_Method VARCHAR2(8) CHECK (Order_Method IN ('Internet','Phone','Mail')),
    Sub_Total NUMBER NOT NULL,
    Delivery_Charge NUMBER NOT NULL,
    Dispatch_Date DATE NOT NULL,
    Carrier_ID NUMBER NOT NULL,
    Grand_Total NUMBER NOT NULL,
    CONSTRAINT tbl_orders_pk PRIMARY KEY (Order_ID));
    ALTER TABLE tbl_orders ADD CONSTRAINT tbl_orders_fk FOREIGN KEY (Customer_ID) REFERENCES tbl_customers (Customer_ID);
    ALTER TABLE tbl_orders ADD CONSTRAINT tbl_orders_fk2 FOREIGN KEY (Carrier_ID) REFERENCES tbl_carriers (Carrier_ID);

所有帮助将不胜感激!谢谢

4

1 回答 1

1

您必须删除代码末尾的尾随分号。

于 2015-06-16T18:56:19.470 回答