Questions tagged [cascading-deletes]

The concept of SQL databases deleting rows that refer (via a foreign key) to a deleted row.

The concept of SQL databases deleting rows that refer (via a foreign key) to a deleted row. The deletion is performed recursively and enabled with the ON DELETE CASCADE property of the foreign key.

587 questions
0
votes
1 answer

Many to many always deletes rows on both tables

When I delete a parent object (not owning one), It delete the row in the other table too, although it might be still referenced by another entities from the first table. I just want to delete the entity in the first table, and of course in the…
user2340939
  • 1,791
  • 2
  • 17
  • 44
0
votes
1 answer

mysql codeigniter active record m:m deletion

I have a table 2 tables that have a m:m relationship, what I can wanting is that when I delete a row from one of the tables I want the row in the joining table to be deleted as well, my sql is as follow, Table 1 CREATE TABLE IF NOT EXISTS…
0
votes
1 answer

why when I delete a parent on a one to many relationship on grails the beforeInsert event is called on the child?

I have a one to many relationship and when I try to delete a parent that haves more than one child the berforeInsert event gets called on the frst child. I have some code in this event that I mean to call before inserting a child, not when i'm…
nico
  • 9,668
  • 8
  • 26
  • 28
0
votes
1 answer

Cascade Delete for MySQL and ASP.NET MVC4

I have create simple asp.net (MVC4) web page with mysql database. There I have two tables (persons and orders), where table orders have FORIGN Key Persons_ID. I whant to create delete function, so, when I delete person from persons table, it will…
DaniKR
  • 2,418
  • 10
  • 39
  • 48
0
votes
1 answer

NHibernate : delete error

Model: I have a model in which one Installation can contain multiple "Computer Systems". Database: The table Installations has two columns Name and Description. The table ComputerSystems has three columsn Name, Description and…
MadSeb
  • 7,958
  • 21
  • 80
  • 121
0
votes
1 answer

How to cascade deletes in Titan DB?

I want to delete a vertex and all vertexes that point to it where the edges between them are from a set of labels - not necessarily all the incoming vertexes. In a relational database you can configure automatic deletion of related entities using…
Ian Warburton
  • 15,170
  • 23
  • 107
  • 189
0
votes
0 answers

EclipseLink Remove Cascade

I have been developing a web application running on the Glassfish Server. I use JPA with EclipseLink implementation. These are my two entity classes. I represent the relation between them below. When I start the Glassfish server and delete the…
Softengilker
  • 173
  • 1
  • 3
  • 11
0
votes
0 answers

How to tell if a SQL index has Casade on Delete enabled?

Is there a SQL query that can tell whether a given index/constraint for a table is set to cascade on delete? FYI, the database I'm using is SQL Azure
Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133
0
votes
1 answer

oracle trigger on delete

Okay so I have been stuck on this for about 2 hours now and I still couldn't find a solution. I have 2 database instances. Site 1 has lets say, Table A id attrib1 foreignKey - (primary key of table B) Site 2 has, Table B id attrib1 I want to…
Hades
  • 3,916
  • 3
  • 34
  • 74
0
votes
0 answers

Core data - to implement OneToMany relationship with cascade delete rule

Need help in implementing delete rule in a core data relationship , I gone through all the article on the net but can't understand to implement the delete rule , does creating relationship takes cares of deletion process (which I doubt ) , I have…
Sushant
  • 3
  • 2
0
votes
3 answers

Cascading Deletes in SQL Sever 2008 not working

I have the following table setup. Bag | +-> BagID (Guid) +-> BagNumber (Int) BagCommentRelation | +-> BagID (Int) +-> CommentID (Guid) BagComment | +-> CommentID (Guid) +-> Text (varchar(200)) BagCommentRelation has Foreign Keys…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
0
votes
1 answer

Cascading delete rows from multiple tables in SQL

I've got two tables with the following structure: Person Id Name Class Id PersonId Sequence and some data: Person 1 name1 2 name2 3 name3 Class 1 1 3 2 1 1 3 1 2 4 2 1 Class table can contain multiple rows related to one…
Steve Macculan
  • 2,292
  • 5
  • 22
  • 32
0
votes
1 answer

doctrine one to many annotation

hello i make a small web site in symfony 2 When i want to remove a categorie with the associated pictures a SQLSTATE Exception is thrown. Despite the fact the key word cascade is present. A foreign key problem with doctrine 2 annotations /** *…
asko
  • 45
  • 4
0
votes
1 answer

Mysql trigger on Delete to multiple tables (also error 1235)

I have 3 tables that are called: character_ learned_skills skills "character_" contains certain informations on a list of characters, while the table "skills" contrains a list of skills. the 3rd table is the list of the skills each character has…
PuchuKing33
  • 381
  • 3
  • 7
  • 19
0
votes
2 answers

How to set OnDelete cascade in entity framework

I have two tables, BookCategory & Books. There can be multiple books for one category. I am using entity framework. On deleting particular BookCategory, I want to delete all books of same category. I am not sure where to set the rule of OnDelete =…
AK47
  • 3,707
  • 3
  • 17
  • 36