小编典典

Oracle ORA-00902无效的数据类型错误

sql

我正在尝试创建两个表,这将引发ORA-00902错误,无法弄清楚这里出了什么问题…

CREATE 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)   
);

提前致谢…


阅读 260

收藏
2021-05-30

共1个答案

小编典典

更改FOREIGN_KEY(MODEL_NO)FOREIGN KEY (MODEL_NO)(无下划线)。

2021-05-30