Board index » delphi » Ref.integrity after restructure

Ref.integrity after restructure

Here's the problem:

I have two tables in master-detail relationship. I am working with Paradox 7
tables and set referential integrity between the two tables. After
restructuring detail table (adding column), referential integrity is
corrupted: I can see that by checking dependant tables for master table
(from Database Desktop or SQL Explorer). What happens is that when I look at
the master table thru SQL Explorer/Referential constraints I find TWO
referential constraints pointing to the detail table and they are linked to
wrong columns in detail table.
I tried restructuring tables from Database Desktop (removing referential
integrity from detail table) but I can't fix it.
Has anyone seen this happen?
What can I do?
All of my tables are linked with referential integrity, it doesn't seem
logical to have to remove all the referential integrity before adding a
column to a table.

Bruno

 

Re:Ref.integrity after restructure


Quote

>I have two tables in master-detail relationship. I am working with Paradox 7
>tables and set referential integrity between the two tables. After
>restructuring detail table (adding column), referential integrity is
>corrupted: I can see that by checking dependant tables for master table
>(from Database Desktop or SQL Explorer). What happens is that when I look at
>the master table thru SQL Explorer/Referential constraints I find TWO
>referential constraints pointing to the detail table and they are linked to
>wrong columns in detail table.
>I tried restructuring tables from Database Desktop (removing referential
>integrity from detail table) but I can't fix it.
>Has anyone seen this happen?
>What can I do?

Referential integrity links are by field postilion.  When you added a new field
did you insert it in before the linked fields?  If so that is where your problem
came from.
Once you have screwed up an RI link all you can do is delete the .val files in
all the associated tables and start over again creating the referential
integrity link.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Ref.integrity after restructure


Hi Bruno,
take a look at
http://www.rksolution.cz/delphi/pxupgr.htm
you will find a shareware utility there that
does restructure Paradox tables even if they
contain referential integrity constraints.
If you need to do this by yourself,
you have to
1) remove referential integrity
2) alter table structure
3) restore the referential integrity
--
Roman
(please remove 'stopspam' in header when replying)
mail: i...@rksolution.cz
URL: www.rksolution.cz

Re:Ref.integrity after restructure


Thanks.
Bruno

Other Threads