I have a set of tables imported from SQL Server to Oracle. During the import process, somehow the dependencies got lost. How do I create the dependencies when tables have already been created?
I used the tool in SQL Server, and exported tables to Oracle.
Yes, I meant Primary Key and Foreign Keys. I know I can create them when I create a table, but I don't know how to creat them after the table is already created, and I don't want to drop all talbes and recreate them again.
Thanks, Turkbear. I've tried it with alter table command, but it always gave me an error saying "parent keys not found" I've checked the parent key, and it's there. What could be wrong here.
This means that your child table contains "orphan" entries (records with no corresponding parents). Read about EXCEPTIONS clause to find them or just run some query like:
select * from child where not exists (select 1 from parent where parent_key=child_key)
Thanks, Dima. It worked. For some reason, when I exported the tables to Oracle, some of the tables failed to export the data when others succeeded. The export tool is truely not reliable at all.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.