当我写这个时,我收到错误“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);
非常感谢所有帮助!感谢
答案 0 :(得分:1)
您必须删除代码末尾的尾部半冒号。