R
Rapi
Hello.
I`ve got a problem with constraints. Simple example
Table1
ID
Name
Primary key ID
Table 2
PARENT_ID
Memo
Foreign key-: PARENT_ID=Table1.ID
(as simple as I could)
When I`ve got constraints on database and dataset and delete row then when I
update dataset: first table1 next table2 I`ve got error. When I change
tables then everything is OK.
As I find out this is because when I delete row in dataset table1 then
constraint "deletes" row in table2 (in dataset). When I update table1 then
databse constraint "deletes" row in table2 (on databse) and when I try to
update Table2 I get error -> there are no such rows (constraints on database
clear them).
How to fix this problem?
When I change the order of updating the tables then I`ve got error on update
command when I insert something.
Can`t I use dataset constraints and handling events of deleting rows in
parent table?
I`ve got a problem with constraints. Simple example
Table1
ID
Name
Primary key ID
Table 2
PARENT_ID
Memo
Foreign key-: PARENT_ID=Table1.ID
(as simple as I could)
When I`ve got constraints on database and dataset and delete row then when I
update dataset: first table1 next table2 I`ve got error. When I change
tables then everything is OK.
As I find out this is because when I delete row in dataset table1 then
constraint "deletes" row in table2 (in dataset). When I update table1 then
databse constraint "deletes" row in table2 (on databse) and when I try to
update Table2 I get error -> there are no such rows (constraints on database
clear them).
How to fix this problem?
When I change the order of updating the tables then I`ve got error on update
command when I insert something.
Can`t I use dataset constraints and handling events of deleting rows in
parent table?