Home > OS >  Oracle - ORA-00903: invalid table name
Oracle - ORA-00903: invalid table name

Time:02-17

I am unable to find the error with this statement:

 CREATE TABLE "FUEL_TRANSPORTATION_TYPES_RARF_ORIG"
  ( "ID" NUMBER(19,0) NOT NULL ENABLE, 
    "CODE" CHAR(2) NOT NULL ENABLE, 
    "DESCRIPTION" VARCHAR2(32), 
    "CREATED" DATE DEFAULT CURRENT_DATE NOT NULL ENABLE, 
    "UPDATED" DATE DEFAULT CURRENT_DATE NOT NULL ENABLE, 
     CONSTRAINT "PK_FUEL_TRANSPORTATION_TYPES" PRIMARY KEY ("ID")
                    USING INDEX (create unique index "UX_FUEL_TRANSPORTATION_TYPES" on "FUEL_TRANSPORTATION_TYPES" ("ID")));

It's failing with error ORA-00903: invalid table name.

Where is the syntax error?

CodePudding user response:

You seem to be using modified DDL from an existing table. You've changed the table name, from FUEL_TRANSPORTATION_TYPES to FUEL_TRANSPORTATION_TYPES_RARF_ORIG; but you didn't change the reference to it in the index:

(create unique index "UX_FUEL_TRANSPORTATION_TYPES" on "FUEL_TRANSPORTATION_TYPES" ("ID"))

should be

(create unique index "UX_FUEL_TRANSPORTATION_TYPES" on "FUEL_TRANSPORTATION_TYPES_RARF_ORIG" ("ID"))

db<>fiddle

CodePudding user response:

I resolved it..

I had a different table name in the using index (create unique index "UX_FUEL_TRANSPORTATION_TYPES" on "FUEL_TRANSPORTATION_TYPES" ("ID"));

IT should be (create unique index "UX_FUEL_TRANSPORTATION_TYPES" on "FUEL_TRANSPORTATION_TYPES_RARF_ORIG" ("ID"));

  • Related