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 -> Foreign key across link?

Foreign key across link?

From: Brian Lavender <blavender_at_spk.usace.army.mil>
Date: Mon, 11 Sep 2000 21:04:12 GMT
Message-ID: <8pjhbt$asq$1@nnrp1.deja.com>

Is it possible to establish a foriegn key relationship between two databases across a link? I have a database that contains a table which contains detailed data related to another database. I figured out how to create a link between the two databases, but if I try to create a foreign key from the detailed table in my local database which requires 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?

Here is the SQL I am trying to use and the error below it.

create table pay_item_detail (

 OBLI_NO                          VARCHAR2(16) NOT NULL,
 DELIVERY_ORDER_NO               VARCHAR2(4) NOT NULL,
 RR_NO                           NUMBER(6) NOT NULL,
 WAD                            VARCHAR2(4) NOT NULL,
 WORK_ORDER                      VARCHAR2(10) NOT NULL,
 LINE_ITEM_NO                   VARCHAR2(6) NOT NULL,
 AMT_PAY                         NUMBER(14,2) default 0.00,
constraint pay_item_detail_pk primary key (obli_no, delivery_order_no, rr_no, wad, work_order, line_i
tem_no),
constraint pay_item_detail_fk1 foreign key (obli_no, delivery_order_no, rr_no, wad, work_order)
references pay_item,
constraint pay_item_detail_fk2 foreign key (obli_no, delivery_order_no, line_item_no)
references obligation_line_item_at_l2cefmp1 )

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 E. Lavender
US Army Corps of Engineers -- Programmer / Systems Analyst
Sacramento, CA    (916) 557-6623


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Sep 11 2000 - 16:04:12 CDT

Original text of this message

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