csteifel
csteifel

Reputation: 2934

Oracle name already in use

I have a script that I am running for homework that looks like so:

drop table burger_king_locations_clean;
drop table burger_king_locations_unresolv;


create table burger_king_locations_clean
(
    ...
);  

create table burger_king_locations_unresolv
(
    ....
);  

But when I run this I get the following message and I don't understand because I know the table is gone and there is no view or any other object with that name.

Table dropped.

drop table burger_king_locations_unresolv
           *
ERROR at line 1:
ORA-00942: table or view does not exist



Table created.


Table created.

create table burger_king_locations_unresolv
             *
ERROR at line 1:
ORA-00955: name is already used by an existing object

I don't understand because this exact thing was working before but I put my computer in sleep mode and then came back to this and now it doesn't work at all. Any ideas?

Upvotes: 0

Views: 1204

Answers (2)

APC
APC

Reputation: 146329

"I have a script that I am running for homework that looks like so"

So you say. But the posted output shows the execution of two DROP statements, one of which fails, and two CREATE statements, one of which is run twice.

Why did the drop table burger_king_locations_unresolv; fail? Who can tell? Perhaps you had already dropped it, perhaps the previous create had failed.

Likewise it is not possible for us to tell you why the create table burger_king_locations_unresolv ran twice. Perhaps your script has a stray back slash following the semi-colon.

Upvotes: 1

Grambot
Grambot

Reputation: 4524

Wouldn't you need to purge the table?

drop table burger_king_locations_clean PURGE;
drop table burger_king_locations_unresolv PURGE;

Upvotes: 0

Related Questions