Questions tagged [referential-integrity]

Referential integrity is a property of data which requires the value of an attribute/column of a relation table to exist as a value of another attribute/column in another relation table

For referential integrity to hold in a relational database, any field in a table that is declared a foreign key can contain either a null value, or only values from a parent table's primary key or a candidate key. In other words, when a foreign key value is used it must reference a valid, existing primary key in the parent table.

http://en.wikipedia.org/wiki/Referential_integrity

353 questions
0
votes
0 answers

Hibernate "Referencial Integrity Constraint Violation" for ManyToMany Bidirectional Mapping

I have the following model stored in a data base. Upon deletion of a room i receive a Referencial Integrity Constraint Violation, which I can't figure out. An important rule for the model is: a person MUST have access to a room. If they lose all…
0
votes
1 answer

Referential integrity sql

i hope you can help me with a general question about referential integrity. If i am deleting data in a table that is referenced to another table as a foreign key. How can i delete the data without violating the referential integrity? Do i have to…
0
votes
2 answers

JavaScript Local Primitive Variable Re-assignment in Recursive Function

I have a recursive function like below function dfs(row, col) { if (grid[row][col] === 0) return true; let result = grid[row][col] === 2; grid2[row][col] = 0; let up = down = left = right = true; // <--- problematic line if (row >…
0
votes
2 answers

Oracle - Foreign Key references different tables different schemas

I have problem with Enforcing Referential Integrity to a new table. There are different tables in different schemas, each one has its primary key: schema1.table1 schema2.table2 schema3.table3 I want to create a new table, which among other…
eathan
  • 33
  • 1
  • 6
0
votes
0 answers

can't update a foreign key but i can delete it already set on CASCADE for both

I tried every solution I can find for this and non of them worked. To explain: I'm trying to update a primary key code_class in the table classroom. This key is also a foreign key in the reservation table. I keep gettimg this error: Warning:…
0
votes
0 answers

Snowflake JDBC database metadata not returning getImportedKeys

I have Java code that extracts metadata from a JDBC connection. One of the calls is to extract the imported keys. The database has the RI created, but is disabled. Is there a way to extract the disabled imported keys?