Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    1

    Unanswered: Dropping and Creating Tables in Oracle

    I have to complete this project, but the help I have recieved so far is no help at all. Please help! I don't understand why I am getting errors. Here is what I have:

    SPOOL PROJECT1.DAT;
    REM Project1;
    REM K Chapon;
    REM The next command will cause you to hit ENTER when screen pauses during execution;
    SET PAUSE ON;
    REM;
    REM DROP TABLES IN REVERSE ORDER CREATED;
    REM Foreign Key Tables Dropped First;
    REM;
    DROP TABLE SUPERBOWL;
    DROP TABLE NFC;
    DROP TABLE AFC;
    REM;
    REM CREATE TABLE AFC;
    REM;
    CREATE TABLE AFC (
    AFC_ID Char(3)P PRIMARY KEY,
    AFC_NAME VarChar(20),
    WINS Number(3),
    LOSSES Number(3)
    );
    REM;
    REM CREATE TABLE NFC;
    REM;
    CREATE TABLE NFC (
    NFC_ID Char(3) PRIMARY KEY,
    NFC_NAME VarChar(20),
    WINS Number(3),
    LOSSES Number(3)
    );
    REM;
    REM CREATE TABLE SUPERBOWL;
    REM;
    CREATE TABLE SUPERBOWL (
    SUPERBOWL_ID Char(3) PRIMARY KEY,
    AFC_ID Char(3) REFERENCES AFC(AFC_ID),
    SB_AFC_NAME VarChar(20),
    AFC_POINTS Number(3),
    NFC_ID Char(3) REFERENCES NFC(NFC_ID),
    SB_NFC_NAME VarChar(20),
    NFC_POINTS NUMBER(3),
    SB_DATE Date
    );
    REM;
    DESCRIBE AFC;
    DESCRIBE NFC;
    DESCRIBE SUPERBOWL;
    REM; Close Output File
    REM;
    SPOOL OFF;

  2. #2
    Join Date
    Nov 2008
    Posts
    5
    Hi,

    You say you don't undersand why you 're getting errors ??

    Just start by reading the errors text !

    Your script only has one error in the AFC table create DDL :

    the line
    Code:
    AFC_ID Char(3)P PRIMARY KEY
    is faulty and should be :

    Code:
    AFC_ID Char(3) PRIMARY KEY,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •