oracle02270,ORA-02270: no matching unique or primary key for this column-list

In apex.oracle.com (Version 4.2.2.00.11), I have tables BPR_PROC (parent) and BPR_RUNTM (child). I'm trying to do this operation:

alter table "BPR_RUNTM" add constraint

"BPR_RUNTM_FK1" foreign key ("PROC_NM") references "BPR_PROC" ("PROC_NM")

/I get the same error through the GUI or with the SQL Commands window.

The TABLE operation was not successful for the following reason:ORA-02270: no matching unique or primary key for this column-list>

I don't want to have a primary key defined but I have defined BPR_PROC_PK as a unique key:

CREATE TABLE "BPR_PROC"

("DSD_ID" VARCHAR2(10) NOT NULL ENABLE,

"PRNT_SEQ_ID" NUMBER(2,0) NOT NULL ENABLE,

"PROC_NM" VARCHAR2(30) NOT NULL ENABLE,

"PARNT_CHLD_IND" VARCHAR2(1),

"PARNT_PROC_NM" VARCHAR2(30),

"WR_APPRX_STRT_TM" VARCHAR2(5),

"OC_APPRX_STRT_TM" VARCHAR2(5),

"OO_APPRX_STRT_TM" VARCHAR2(5),

"KD_APPRX_STRT_TM" VARCHAR2(5),

"NTFCTN_REQ_TX" VARCHAR2(10),

"PROC_CYC_TX" VARCHAR2(25),

"JOB_LNG_NM" VARCHAR2(100)

)

/

CREATE INDEX "BPR_PROC_IDX1" ON "BPR_PROC" ("DSD_ID", "PRNT_SEQ_ID", "PROC_NM")

/

CREATE UNIQUE INDEX "BPR_PROC_PK" ON "BPR_PROC" ("PROC_NM")

/So, shouldn't this work? What am I doing wrong?

[Aside: I want a FK because some functionality in Master-Detail only seems to work if there is a FK.]

You can check it out here.

WS APEX_EXAMPLES_01

demo

demo

Thanks,

Howard

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值