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

  • Home
  • SEARCH
  • 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 502387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:17:10+00:00 2026-05-13T06:17:10+00:00

I created a simple databse using Oracle that has several tables and a few

  • 0

I created a simple databse using Oracle that has several tables and a few constraints, i am using Access 2007 to interact with the database.

My problem is that I have a table that is called “Customer” which holds several fields, most notably a Primary Key called CUSTID.

I have another table called “Order” which uses the Primary Key in “Customer” as a Foreign Key.

Obviously if i try to delete a customer that is being used in “Order” i get an error as it’s being used. This means i have to delete the particular order that references the Customer and then i can delete the Custome record.

I know that “cascade” should delete everything associated with it, my question is how can i do that from Access? I have limited knowledge of databases but enough to create one etc..

This is more of a validation thing, it’s just a hassle to delete certain tuples before i can remove another.

This is the database created for Oracle:

--Used to create a "Clean" slate
DROP TABLE ITEM CASCADE CONSTRAINTS;
DROP TABLE CUSTOMER CASCADE CONSTRAINTS;
DROP TABLE CORDER CASCADE CONSTRAINTS;
DROP TABLE FORUM CASCADE CONSTRAINTS;

CREATE TABLE ITEM 
(
ITEMID              NUMBER(4) NOT NULL,
NAME               CHAR(15) NOT NULL,
CATEGORY            CHAR(15) NOT NULL,
PRICE    NUMBER(8) NOT NULL,
CONSTRAINT ITEM_PK PRIMARY KEY (ITEMID)
);


INSERT INTO ITEM VALUES (1000,'CARROT SEEDS','PACKET SEEDS',2.99);
INSERT INTO ITEM VALUES (2250,'ROSES','FLOWERS',5.99);
INSERT INTO ITEM VALUES (3300,'TOMATOES','PACKET SEEDS',2.99);
INSERT INTO ITEM VALUES (4050,'POTATOES','PACKET SEEDS',1.99);


CREATE TABLE CUSTOMER 
(
 CUSTID              NUMBER(4) NOT NULL,
 FNAME               CHAR(10) NOT NULL,
 LNAME               CHAR(10) NOT NULL,
 ADDRESS             CHAR(40) NOT NULL,
 CITY        CHAR(15) NOT NULL,
 PCODE               CHAR(7) NOT NULL,
 CNUMBER             NUMBER(11) NOT NULL,
 CONSTRAINT CUSTOMER_PK PRIMARY KEY (CUSTID)
 );

INSERT INTO CUSTOMER VALUES (1010,'JAMIE','KEELING','149 OLD MANSFIELD ROAD','DERBY','DE214SA',07500966490);
INSERT INTO CUSTOMER VALUES (2020,'HELEN','DARLINGTON','27 MOORPARK AVENUE','ROCHDALE','OL113JQ',07890189802);
INSERT INTO CUSTOMER VALUES (3030,'STEVEN','SEGAL','123 FAKE STREET','OHIO','SE095BG',01559345467);
INSERT INTO CUSTOMER VALUES (4040,'BRUCE','WAYNE','17 LAKEVIEW CRESCENT','CHICAGO','MN432BD',07500966490);


CREATE TABLE CORDER 
(
 ORDERID             NUMBER(4) NOT NULL,
 CUSTID              NUMBER(4) NOT NULL,
 SHIPADD    CHAR(40) NOT NULL,
 SHIPPCODE    CHAR(7) NOT NULL,
 SHIPDATE    DATE,
 ITEMID              NUMBER(4) NOT NULL,
 QUANTITY    NUMBER(3) NOT NULL,
 TOTAL     NUMBER(8) NOT NULL,
 CONSTRAINT ORDER_PK PRIMARY KEY (ORDERID),
 CONSTRAINT FK_CUSTOMER FOREIGN KEY (CUSTID) REFERENCES CUSTOMER(CUSTID),
 CONSTRAINT FK_ITEM FOREIGN KEY (ITEMID) REFERENCES ITEM(ITEMID)
);

 INSERT INTO CORDER VALUES (1000,1010,'149 OLD MANSFIELD ROAD','DE214SA','12-JAN-07',1000,100,100.00);
 INSERT INTO CORDER VALUES (2000,2020,'27 MOORPARK AVENUE','OL113JQ','04-NOV-10',2250,200,100.00);
 INSERT INTO CORDER VALUES (3000,3030,'123 FAKE STREET','SE095BG','30-OCT-08',3300,150,100.00);
 INSERT INTO CORDER VALUES (4000,4040,'17 LAKEVIEW CRESCENT','MN432BD','25-JUL-07',4050,125,100.00);


 CREATE TABLE FORUM
 (
 FORUMID  NUMBER(4) NOT NULL,
 TITLE   CHAR(30) NOT NULL,
 THREADNAME  CHAR(30) NOT NULL,
 POSTER   CHAR(20) NOT NULL,
 POSTDATE  DATE,
 CONSTRAINT FORUM_PK PRIMARY KEY (FORUMID)
 );

 INSERT INTO FORUM VALUES (1001,'GENERAL CHAT','BEGINNER QUESTIONS','JAMIE KEELING', '25-NOV-09');
 INSERT INTO FORUM VALUES (2002,'OFF TOPIC','FAVOURITE BAND','HELEN DARLINGTON', '12-JAN-09');
 INSERT INTO FORUM VALUES (3003,'GENERAL CHAT','WHEN TO HARVEST?','BRUCE WAYNE', '02-NOV-08');
 INSERT INTO FORUM VALUES (4004,'OFF TOPIC','WHERE DO YOU LIVE?','STEVEN SEGAL', '13-JAN-08');
  • 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-05-13T06:17:10+00:00Added an answer on May 13, 2026 at 6:17 am

    Standard SQL way to create foreign key with ON DELETE CASCADE is following. I don’t know if Access supports this, but Oracle does have support for ON DELETE CASCADE.

    alter table CORDER
    add foreign key FK_CUSTOMER
    references CUSTOMER(custid)
    on delete cascade
    

    If you are re-creating tables, you can also define the foreign keys with on delete cascade in table creation statement. i.e. replace this

    CONSTRAINT FK_CUSTOMER FOREIGN KEY (CUSTID) REFERENCES CUSTOMER(CUSTID)
    

    with this

    CONSTRAINT FK_CUSTOMER FOREIGN KEY (CUSTID) REFERENCES CUSTOMER(CUSTID) ON DELETE CASCADE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.