var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Foreign Key Issue
I am facing an issue regarding the implementation of foreign key constraints in ASE 15.0.3.
I have got two tables Table1 and Table 2
Table1 ( x int , y int) and column x is primary key for the table1
This table has no data.
Table2 ( a int , b int) and column a is primary key for the table2
Table2 has some data like (1,1)
Now Table2.b has to refer Table1.x (new requirement)
so i create a FK with statement
alter table Table2
add constraint fk1 foreign key (b) references Table1(x)
I execute the above script and it works fine. FK is created.
But the problem is that table1 has got no data where as Table2 has a few rows but still FK was created.
Can any one explain why ASE didn't give any error or warning.
and how to make ASE give warning for pre-existing rows in child table
Reference Manual: Commands
"Constraints do not apply to the data that already exists in the table at the time the constraint is added."