Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2010
    Posts
    4

    Unanswered: create table problems

    Hey guys. I'm new here and I have a question for you. I have a file that when run is supposed to create 6 tables. Its called Tables.sql. When I run it in sqlplus all the terminal returns is the number of the last line of the code.

    Here is the script I am running...

    CREATE TABLE Books(
    Titel char(60),
    Author char(25),
    ISBN int(13),
    Department char(10),
    Library_ID int(4),
    Status char(12),
    PRIMARY KEY (Library_ID))
    --
    CREATE TABLE Clients(
    First_Name char(6),
    Last_Name char(8),
    Address char(25),
    Card_Number int(6),
    Phone_Number int(7),
    PRIMARY KEY (Card_NUMBER))
    --
    CREATE TABLE Checked_Out(
    Card_Number int(6),
    Library_ID int(4),
    Date_Checked_Out char(15),
    PRIMARY KEY (Library_ID),
    FOREIGN KEY (Library_ID) REFERENCES Books(Library_ID))
    --
    CREATE TABLE Employee(
    First_Name char(10),
    Last_Name int(8),
    Address char(20),
    SSN int(9),
    PRIMARY KEY (SSN))
    --
    CREATE TABLE Department(
    SSN int(9),
    Department Char(10),
    PRIMARY KEY (SSN),
    FOREIGN KEY (SSN) REFERENCES Employee(SSN))
    --
    CREATE TABLE Overdue(
    Card_Number int(6),
    Library_ID int(4),
    Fine_Amount double(3,2),
    PRIMARY KEY (Library_ID),
    FOREIGN KEY (Library_ID) REFERENCES Checked_Out(Library_ID))

    The command I use to run the script...
    @Tables.sql

    No error messages are displayed. All that is returned is the number 44.

    Thanks for any help.

    --
    spalk621

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    You are missing a semicolon after each create table.

    And please use [code] tags the next time you post SQL statements.

  3. #3
    Join Date
    Apr 2010
    Posts
    4
    Sure thing. Sorry about that and thank you.

Posting Permissions

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