Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:55:54+00:00 2026-06-03T00:55:54+00:00

I’m trying to run a script which is just a series of drop tables

  • 0

I’m trying to run a script which is just a series of drop tables and create tables. It compiles but when it runs I get the following error: ORA-00942 table or view does not exist. They shouldn’t exist I’m trying to create them! Anyone have any idea as to why this might be happening? I’m using the Oracle interface, not the command line. I’ve created the code in Notepad++ and uploaded it to Oracle. I then save and run the script within Oracle. When I click view results the error appears.

EDIT: I’ve now noticed that it’s only the tables that have foreign keys that are not being created!

This is an excerpt from my code:

CREATE TABLE PricePlans (
plan_id NUMBER(3) NOT NULL,
plan_name VARCHAR2(15) NOT NULL,
plan_desc VARCHAR2(30) NOT NULL,
plan_duration_months NUMBER(2) NOT NULL,
plan_cost NUMBER(4) NOT NULL,
CONSTRAINT pk_planid PRIMARY KEY (plan_id)
);

DROP TABLE Classes;
CREATE TABLE Classes (
class_id NUMBER(3) NOT NULL,
class_name VARCHAR2(30) NOT NULL,
class_desc VARCHAR2(30) NOT NULL,
class_facility NUMBER(2) NOT NULL,
class_instructor NUMBER(5) NOT NULL,
class_cost NUMBER(2) NOT NULL,
CONSTRAINT pk_classid PRIMARY KEY (class_id),
CONSTRAINT fk_classfacility 
    FOREIGN KEY (class_facility) 
    REFERENCES Facilities(facility_id),
CONSTRAINT fk_classinstructor 
    FOREIGN KEY (class_instructor) 
    REFERENCES Employees(emp_id)
);

DROP TABLE Facilities;
CREATE TABLE Facilities (
facility_id NUMBER(2) NOT NULL,
facility_name VARCHAR(15) NOT NULL,
facility_manager NUMBER(4) NOT NULL,
CONSTRAINT pk_facilityid PRIMARY KEY (facility_id);
CONSTRAINT fk_facilitymanager 
    FOREIGN KEY (facility_manager) 
    REFERENCES Manager(manager_id)
);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:55:56+00:00Added an answer on June 3, 2026 at 12:55 am

    I believe that DROP TABLE statements in your query are trying to drop the tables that don’t exist.

    Remove the following lines from your script.

    DROP TABLE Classes;
    
    DROP TABLE Facilities;
    

    You can check if the table exists or not before executing the DROP TABLE statements. Here are few SO answers that might help you with that.

    Oracle: If Table Exists

    Check if table exists in the database – PL SQL

    UPDATE

    In the CREATE TABLE statement of Classes, the foreign key fk_classfacility is referencing the table Facilities, which is being created later. Try to switch the CREATE TABLE statements. Create the Facilities table first and then create the Classes table.

    I assume that all the other tables referenced in the constraints already exist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I would like to run a str_replace or preg_replace which looks for certain words
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm trying to select an H1 element which is the second-child in its group
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.