Oracle ORA-00902无效的数据类型错误
技术问答
479 人阅读
|
0 人回复
|
2023-09-12
|
我试图创建两个表,这将导致ORA-00902错误,这里出了什么问题…
7 c. w; ^0 t1 _- B2 BCREATE TABLE VEHICLE_STORE( MODEL_NO VARCHAR2(12) NOT NULL, DESCRIPTION VARCHAR2(1000) NOT NULL, UNIT_PRICE NUMBER(10) NOT NULL, CURRENT_STOCK NUMBER(5) NOT NULL, CC NUMBER(3) NOT NULL, CONSTRAINT vehicle_store_pk PRIMARY KEY(MODEL_NO));CREATE TABLE VEHICLE_BOOKING( BOOKING_ID VARCHAR2(12) NOT NULL, CUSTOMER_NAME VARCHAR2(30) NOT NULL, EMAIL_ID VARCHAR2(30) NOT NULL, CONTACT NUMBER(15) NOT NULL, ADDRESS VARCHAR2(500) NOT NULL, PINCODE NUMBER(10) NOT NULL, MODEL_NO VARCHAR2(12) NOT NULL, DATE_OF_BOOKING VARCHAR2(12) NOT NULL, EXPECTED_DATE_OF_DELIVERY VARCHAR2(12) NOT NULL, CONSTRAINT vehicle_booking_pk PRIMARY KEY(BOOKING_ID), CONSTRAINT vehicle_booking_fk FOREIGN_KEY(MODEL_NO) REFERENCES VEHICLE_STORE(MODEL_NO) );提前致谢…* p" y ]% x3 ]$ Y( y
" @; Q9 Q. j+ g7 m& i 解决方案: " [* k. L0 D- W% q
更改FOREIGN_KEY(MODEL_NO)为FOREIGN KEY (MODEL_NO)(无下划线)。 |
|
|
|
|
|