OttoMeter
OttoMeter

Reputation: 3

ORA-00955 during SQL Table creation

I have been getting the error during a table creation. I know it means that the table name needs to change, but I don't see any object with the same name. A copy of the .lst is below.

Thanks

SQL> CREATE TABLE CUSTOMERtable
  2   (
  3          CUSTOMERID      INT NOT NULL,
  4          CUSTNAME        VARCHAR2 (50) NOT NULL,
  5          ADDRESS         VARCHAR2 (100) NOT NULL,
  6          PHONENUMBER     VARCHAR2 (10)   NOT NULL,
  7          CONSTRAINT IDS_CUST_PK PRIMARY KEY (CUSTOMERID)
  8   );
CREATE TABLE CUSTOMERtable
             *
ERROR at line 1:
ORA-00955: name is already used by an existing object 


SQL>
SQL> 
SQL> CREATE TABLE RENTALStable
  2  (
  3          RENTALID        INT         NOT NULL,
  4          OUTDATE         DATE    NOT NULL,
  5          INDATE      DATE    NOT NULL,
  6          LATEFEE         INT,
  7          DAMAGEFEE       INT,
  8          REWINDFEE       INT,
  9          ID_CUSTOMER INT,
 10          CONSTRAINT RentalsTable_IDS_PK PRIMARY KEY (RENTALID),
 11          FOREIGN KEY (ID_CUSTOMER) REFERENCES CUSTOMERtable(CUSTOMERID)
 12  );

 Table created.

Upvotes: 0

Views: 796

Answers (1)

Aleksej
Aleksej

Reputation: 22949

This should find the object that's creating the problem:

select *
  from user_objects
  where object_name = 'CUSTOMERTABLE'

Notice that your statement, even if you write CUSTOMERtable ( upper and lower case), will try to create a table named CUSTOMERTABLE (upper case). If you want to keep two objects with the same names but different case (and it seems not a good idea to me) you should use double quotes:

CREATE TABLE "CUSTOMERtable" ( ...

Upvotes: 1

Related Questions