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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:36:14+00:00 2026-06-02T06:36:14+00:00

If i have this structure: table users id_user 1 2 table lists id_lists name_list

  • 0

If i have this structure:

table users

id_user
1
2

table lists

id_lists    name_list   users_id_user
    1           Work              1
    2           work              2

lists_has_users

users_id_user   lists_id_lists
    1                      2
    2                      1

What I want is, when delete the id_lists, I also want to delete all the users that are members of that list in list_has_users

For example if i delete the id_lists 1, the lists_id_lists 1 should also be deleted.

At the moment i get: Cannot delete or update a parent row

How solve this?

  • 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-02T06:36:17+00:00Added an answer on June 2, 2026 at 6:36 am

    It seems as though you have a FOREIGN KEY constraint defined which enforces referential integrity, and prohibits you from deleting a parent row if children exist. Modify your foreign key to include ON DELETE CASCADE to force deletion of child rows.

    Use DESCRIBE lists_has_users to get the FK’s symbol if you don’t know it.

    ALTER TABLE lists_has_users DROP FOREIGN KEY `key_symbol`;
    ALTER TABLE lists_has_users ADD FOREIGN KEY (lists_id_lists) REFERENCES lists (id_lists) ON DELETE CASCADE
    

    You may want to add ON UPDATE CASCADE as well, so that the lists_has_users row changes if the id of lists ever changes.

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

Sidebar

Related Questions

I have this table structure and would like to map it using Fluent Hibernate
I have a table structure like this: <table> <tr> <td> <ul> <li class=check></li> </ul>
I have my Table structure like this :: ATT_Table : Fields - Act_ID, Assigned_To_ID,
If I have a table structure like this: Transaction [TransID, ...] Document [DocID, TransID,
I have created a table on an Oracle 10g database with this structure :
I have a table structure with columns like this [ID] [Name] [ParentId] [ParentName] The
I currently have a table structure that looks something like this(some details omitted): ColumnName
I have an activity table with a structure like this: id prd_id act_dt grp
I have a table that has records with a structure similar to this.. ID
So, i have this table structure +----+---------+-----------+---------+------+---------------------+ | id | to_user | from_user |

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.