Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Foreign key across link?

Re: Foreign key across link?

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Tue, 12 Sep 2000 14:47:01 GMT
Message-ID: <39BE41E5.69B731A6@edcmail.cr.usgs.gov>

> the parent key be in the parent database, Oracle won't allow me to do
> it. So, is there another way to do this, or should I just code it in my
> application?
 

> The reported error
>
> SQL> @pay_item_detail.sql
> references obligation_line_item_at_l2cefmp1
> *
> ERROR at line 13:
> ORA-02021: DDL operations are not allowed on a remote database

Brian,

  This answers your question in your subject line. No, you can not have a FK across a link. It is not allowed (which is a good thing in my opinion). If you must establish a FK across a link, then you'll either have to code it in your application or use triggers. But I must caution you against employing this design. Database links do have their problems and rely on network availability between databases. Any network problems can cause your application to break down. Personally, I'd do everything in my power to not design FK constraints between two different databases. But in the end, you'll have to do what is best for your situation.

HTH,
Brian

-- 
========================================
Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my 
company!
========================================
Received on Tue Sep 12 2000 - 09:47:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US