search

Home  >  Q&A  >  body text

How to solve the problem of "ORA-00922: missing or invalid option" error?

<p>I entered the following SQL command in Oracle, but it reported the error "ORA-00922: Option is missing or invalid"</p> <pre class="brush:php;toolbar:false;">CREATE TABLE Student ( StuID NUMBER(15), StuName VARCHAR2(50), Phone VARCHAR2(20), PRIMARY KEY (StuID)) CREATE TABLE Program ( ProCode VARCHAR2(12), ProTitle VARCHAR2(50), PRIMARY KEY (ProCode))</pre> <p>Why? ? ? </p>
P粉668804228P粉668804228522 days ago961

reply all(2)I'll reply

  • P粉242535777

    P粉2425357772023-08-23 17:10:21

    创建表 Student (
        StuID     NUMBER(15),
        StuName   VARCHAR2(50),
        Phone     VARCHAR2(20),
        CONSTRAINT PK_STUID PRIMARY KEY (StuID))

    Find the answer here here.

    edit:

    Also, try using / as statement separator instead of ;

    reply
    0
  • P粉099145710

    P粉0991457102023-08-23 13:27:54

    If you are using OracleXE's horrible HTML GUI (inside the browser), then it does not support running multiple statements.

    Please use SQL Developer, SQL*Plus or any other GUI tool instead.

    reply
    0
  • Cancelreply