1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

ora-00904 Error, help!

Discussion in 'General' started by mwhitedesigns, Jul 20, 2012.

  1. mwhitedesigns

    mwhitedesigns Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    Hey Guys!
    First post here. First off i want to say thank you for the time and committment you guys provide here helping others out.

    Now I am relatively new to SQL. And I have this code and i keep receiving an error. It states its at line 9.


    Code (Text):
    SQL> Create Table Employee(
    2   EmpNumber INTEGER,
    3   EmpFirstName CHAR(25),
    4     EmpLastName CHAR(25),
    5   CommisionRate DECIMAL(3,2),
    6   YrlySalary NUMBER(7,2),
    7   DepartmentID VARCHAR(10),
    8   JobID VARCHAR(10),
    9   );
    Thoughts please?
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Yes. You have a comma where it doesn't belong on line 8; remove it.
     
  3. mwhitedesigns

    mwhitedesigns Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    Thanks, what if you do this instead, would it still be ok?
    Code (Text):

    8   JobID VARCHAR(10));
     
     
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Yes, that's just fine -- but you'd have found that out when you executed the statement. :)


    Code (SQL):
    SQL> CREATE TABLE Employee(
      2    EmpNumber INTEGER,
      3    EmpFirstName CHAR(25),
      4    EmpLastName CHAR(25),
      5    CommisionRate DECIMAL(3,2),
      6    YrlySalary NUMBER(7,2),
      7    DepartmentID VARCHAR(10),
      8    JobID VARCHAR(10),
      9  );
    )
    *
    ERROR at line 9:
    ORA-00904: : invalid identifier

    SQL>
    SQL>
    SQL> CREATE TABLE Employee(
      2    EmpNumber INTEGER,
      3    EmpFirstName CHAR(25),
      4    EmpLastName CHAR(25),
      5    CommisionRate DECIMAL(3,2),
      6    YrlySalary NUMBER(7,2),
      7    DepartmentID VARCHAR(10),
      8    JobID VARCHAR(10)
      9  );
     
    TABLE created.
     
    SQL>
    SQL> DROP TABLE employee purge;
     
    TABLE dropped.
     
    SQL>
    SQL> CREATE TABLE Employee(
      2    EmpNumber INTEGER,
      3    EmpFirstName CHAR(25),
      4    EmpLastName CHAR(25),
      5    CommisionRate DECIMAL(3,2),
      6    YrlySalary NUMBER(7,2),
      7    DepartmentID VARCHAR(10),
      8    JobID VARCHAR(10));
     
    TABLE created.
     
    SQL>
    SQL> DROP TABLE employee purge;
     
    TABLE dropped.
     
    SQL>
     
    mwhitedesigns likes this.
  5. mwhitedesigns

    mwhitedesigns Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    Thank you much :) Hope you have a wonderful afternoon. Oh and my thoughts and prayers are with your community :)
     
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    We appreciate the thoughts. It was a horrible way to start the day.
     
  7. mwhitedesigns

    mwhitedesigns Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    You are very welcome. I could only imagine.

    On a side note, I'm sure you guys will be seeing alot of me in the upcoming days/weeks/months. Hope you have a good afternoon.

    THanks again.
     
  8. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Where are you located, if I may ask?
     
  9. mwhitedesigns

    mwhitedesigns Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    I am located in Richmond, Virginia.
     
  10. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Nice to have you join the forum.
     
    mwhitedesigns likes this.