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 8101259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:56:25+00:00 2026-06-05T22:56:25+00:00

I am trying to configure the CLIENTS table on my database such that if

  • 0

I am trying to configure the CLIENTS table on my database such that if an employee is deleted from the EMP table any associated clients are automatically deleted from the CLIENTS table.

This is what I’ve tried so far.

ALTER TABLE clients
MODIFY empno REFERENCES emp(empno) ON DELETE CASCADE

Unfortunately this returns a near “MODIFY”: syntax error every time I try to run it. Any idea what is going wrong?

Thanks in advance.

  • 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-05T22:56:27+00:00Added an answer on June 5, 2026 at 10:56 pm

    Use this:

    ALTER TABLE Clients
      ADD CONSTRAINT `Client_1`
        FOREIGN KEY empno REFERENCES emp(empno) ON DELETE CASCADE;
    

    UPD:

    According to this post, there is no way you can do that in SQLite. Therefore, my suggestion is this:

    • Create a temporary table.
    • Copy all the info there.
    • Drop the original table and create it with foreign key.
    • Copy all info from temporary table and remove the temporary table.

    Of course, if the Clients table is empty right now, you can simply delete it and recreate.

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

Sidebar

Related Questions

I am trying to configure dhclient. The specification says that I should add vendor-specific
I'm trying to configure a logger from a yaml file. On docs.python.org I found
I'm trying to configure a Bugzilla instance, which will allow my clients to login,
Trying to configure Jenkins CI. Currently just running it from the .war (eventual intention
I'm trying to configure puppetmaster and puppet clients using Ubuntu 11.10 EC2 Instances (ami-a562a9cc).
I'm trying to configure a web application that can use client-side JavaScript for localization
I'm trying to configure Nginx to work with Socket.IO and I have found this
I'm trying to parse the result from a RESTFull call using RestTemplate following this
I am trying configure unicorn + nginx in my ubunton 10.04 in linode for
I am trying to configure Apache on my Linux system, but it does not

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.