ORA-00922 Missing or Invalid Option

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yew12
    New Member
    • Mar 2008
    • 23

    ORA-00922 Missing or Invalid Option

    Hi,

    Does anyone know why I get this error when I run this script.
    [code=oracle]

    Create table ROOM
    (ROOM_ID number(4),
    PROPERTY_ID number(4) Not Null,
    ROOM_TYPE char(15) Not Null,
    HEATING char(3) Not Null,
    FURNISHED char(3) Not Null,
    DIMENSIONS char(11) Not Null,
    SPECIAL_FEATURE S char(30) Null,
    Primary Key(ROOM_ID,PRO PERTY_ID),
    Constraint PROPERTY_ID_FK Foreign Key(PROPERTY_ID ) References PROPERTY(PROPER TY_ID),
    Constraint Room_Type_CK Check(ROOM_TYPE in('Reception room','Bathroom ','Bedroom','Ut ility','Kitchen ')),
    COnstraint Heating_CK Check(HEATING in('Yes','No')) ,
    Constraint Furnished_CK Check(FURNISHED in('Yes','No')) );
    [/code]
    Thanks very much in advance.
    Last edited by amitpatel66; Mar 14 '08, 03:13 PM. Reason: code tags
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    I do not face any issue:

    [code=oracle]

    SQL> Create table ROOM
    2 (ROOM_ID number(4),
    3 PROPERTY_ID number(4) Not Null,
    4 ROOM_TYPE char(15) Not Null,
    5 HEATING char(3) Not Null,
    6 FURNISHED char(3) Not Null,
    7 DIMENSIONS char(11) Not Null,
    8 SPECIAL_FEATURE S char(30) Null,
    9 Primary Key(ROOM_ID,PRO PERTY_ID),
    10 Constraint PROPERTY_ID_FK Foreign Key(PROPERTY_ID ) References PROPERTY(PROPER TY_ID),
    11 Constraint Room_Type_CK Check(ROOM_TYPE in('Reception room','Bathroom ','Bedroom','Ut ility','Kit')),
    12 COnstraint Heating_CK Check(HEATING in('Yes','No')) ,
    13 Constraint Furnished_CK Check(FURNISHED in('Yes','No')) )
    14 /

    Table created.

    SQL>



    [/code]

    Comment

    • Yew12
      New Member
      • Mar 2008
      • 23

      #3
      Thank you for your response we know think its the order in which we have created the tables.

      Thanks

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Originally posted by Yew12
        Thank you for your response we know think its the order in which we have created the tables.

        Thanks
        You need to have your property table in palce before creating ROOM table. But this does not display error like invalid option or something, it will say property table or view does not exist.

        Comment

        • Priyanka17
          New Member
          • Aug 2008
          • 1

          #5
          Hi ,

          I have got the same Error.
          ORA-00922 Missing or invalid option .
          While creating first database while installation.
          Will you please assist me on this error?

          Thanks in advance.

          Regards,
          Priyanka

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Kindly Post Your Code That You Are Working On.

            Comment

            • samir pradhan
              New Member
              • Jul 2008
              • 7

              #7
              Originally posted by Priyanka17
              Hi ,

              I have got the same Error.
              ORA-00922 Missing or invalid option .
              While creating first database while installation.
              Will you please assist me on this error?

              Thanks in advance.

              Regards,
              Priyanka


              Hi Priyanka.

              i m confused that u got the error while installation.
              as i know

              ORA-00922 Missing or invalid option, causes due to syntax error.

              specifying a maximum length on a date or long datatype also
              causes this error.

              or like Yew12's case where Yew12 was trying to create the ROOM table first before creating PROPERTY table also causes this error.


              Correcting the syntax may help u to overcome from the error.

              Comment

              Working...