Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Foreign key across link?
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
The reported error
SQL> @pay_item_detail.sql
references obligation_line_item_at_l2cefmp1
*
-- 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
![]() |
![]() |