查询只创建10个表中的7个..请帮助吗?

时间:2014-02-20 21:32:43

标签: sql oracle11g

我设计了这个查询来创建10个表 - 但是它会创建7然后停止。我不知道为什么。我已经筋疲力尽了所有我想要寻找的东西。这是脚本 - 任何帮助将不胜感激。

ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';

CREATE TABLE CUSTOMER (
CUSTOMER_ID INTEGER,
CUST_FNAME VARCHAR2(20),
CUST_LANME VARCHAR2(20),
CUST_ADDRESS VARCHAR2(20),
CUST_CITY VARCHAR2(20),
CUST_ZIPCODE VARCHAR2(10),
CUST_STATE VARCHAR2(15),
CUST_PHONE VARCHAR2(15),
CUST_EMAIL VARCHAR2(35),
CUST_cODE INTEGER,
POLICY_NUMBER VARCHAR2(20));

/* -- */

CREATE TABLE VEHICLE(
VIN_NUMBER VARCHAR2(30),
MANUFACTURER VARCHAR2(20),
MAKE VARCHAR2(15),
MODEL VARCHAR2(15),
YEAR VARCHAR2(4),
MILEAGE VARCHAR2(7),
CUSTOMER_ID VARCHAR2(10));


/* -- */

CREATE TABLE PART(
PART_ID VARCHAR2(20),
PART_DESCRIPTION VARCHAR2(35),
PART_ORGIN_PRICE NUMBER(10),
SUPPL_ID INTEGER);


/* -- */


CREATE TABLE PAYMENT(
PAYMT_ID VARCHAR2(15),
PAYMT_DATE DATE,
PAYMENT_METHOD VARCHAR2(10),
COMP_CODE INTEGER,
CUSOTMER_ID INTEGER,
BILL_NUMBER INTEGER);

/* -- */

CREATE TABLE REPAIR_LINE(
BILL_NUMBER INTEGER,
VIN_NUMBER INTEGER,
REPAIR_CODE INTEGER,
START_TIME DATE,
END_TIME DATE,
PARTS VARCHAR2(25),
EMP_ID INTEGER,
PART_ID INTEGER,
PART_PRICE NUMBER(10));


/* -- */

CREATE TABLE SUPPLIER(
SUPPL_ID INTEGER,
SUPPLY_NAME VARCHAR2(25),
SUPPLY_ADDRESS VARCHAR2(20),
SUPPLY_CITY VARCHAR2(20),
SUPPLY_ZIPCODE VARCHAR2(10),
SUPPLY_STATE VARCHAR2(15),
SUPPLY_EMAIL VARCHAR2(35),
SUPPLY_PHONE VARCHAR2(20));



/* -- */

CREATE TABLE INSURANCE(
COMP_CODE INTEGER,
COMP_NAME VARCHAR2(25),
COMP_ADDRESS VARCHAR2(20),
COMP_CITY VARCHAR2(20),
COMP_ZIPCODE VARCHAR2(10),
COMP_STATE VARCHAR2(15),
COMP_EMAIL VARCHAR2(35),
AGENT_PHONE VARCHAR2(20));


/* -- */

CREATE TABLE BILL(
BILL_NUMBER INTEGER,
BILL_DATE DATE,
B_AMOUNT_INSURED NUMBER(10),
B_AMOUNT_CUST NUMBER(10),
bILL_STATUS VARCHAR2(15));


/* -- */

CREATE TABLE REPAIR(
BILL_NUMBER INTEGER,
REPAIR_CODE INTEGER,
DATE DATE,
LABOR NUMBER,
TAX_RATE NUMBER,
TOT_BEFORETAX NUMBER,
TOTAL NUMBER(10),
REPAIR_TYPE VARCHAR2(15));

/* -- */

CREATE TABLE EMPLOYEE(
EMP_ID INTERGER,
EMP_FNAME VARCHAR2(25),
EMP_LNAME VARCHAR2(25),
EMP_ADDRESS VARCHAR2(20),
EMP_CITY VARCHAR2(20),
EMP_ZIPCODE VARCHAR2(10),
EMP_STATE VARCHAR2(15),
EMP_EMAIL VARCHAR2(35),
EMP_PAYRATE NUMBER(10),
EMP_PHONE VARCHAR2(20));

/ * - * /

2 个答案:

答案 0 :(得分:2)

脚本中有一些错误:

in VEHICLE table, YEAR may be reserved word.  change it to something else.

in REPAIR table, DATE is a reserved word.  change it to something else.

in EMPLOYEE table, EMP_ID INTERGER ... spelling error.  change to INTEGER.

然后再试一次。

答案 1 :(得分:1)

DATEreserved word,因此您不能将其用作列名,就像您在REPAIR表中尝试的那样。您将收到ORA-00904,“无效的标识符”错误。

您的客户应该告诉您正在发生的错误。为什么其他任何人都会遇到问题并不明显;除了,正如BWS指出的那样,你拼错了INTERGER(ORA-00902)。显示错误,甚至是创建和未创建的表,当然会有所帮助。