• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 645
  • Last Modified:

ORA-02270

dear friend

my master table is COMMON_SECTION in schema HRMS with columns
                            Section_id number(2);     Primary key
                            Section_name varchar2(35);

my child table is    FABRIC_ISSUE        in schema SMS with columns
                            Fabric_id number(7);      Primary Key
                            Fabric_name varchar2(35);
                            FROM_SECTION number(2);  "wana make it FK of section_id"

now i wanna make FROM_SECTION foreign key of Section_id which is a primary key in some other schema with a different name

it issues error ORA-02270: no matching unique or primary key for this column-list

i tried making synonyms of common_section into SMS schema where my child table is. same i tried making view but to no avail.

kinldy sooner gimme some solution
0
azharmateen
Asked:
azharmateen
1 Solution
 
MohanKNairCommented:
Try this command

alter table SMS.FABRIC_ISSUE add constraint FABRIC_ISSUE_fk_frm_sect foreign key(FROM_SECTION) references HRMS.COMMON_SECTION(Section_id);

0
 
azharmateenAuthor Commented:
dear brother

usually this is the command that is used to add a foreign key between schamas and i had been using the same command with schema ref but it didnt help so i put the question on this site.

i have done it with some other way and i even share it with u. infact it was the problem of grants. i connected the schema of HRMS and wrote GRANT REFERENCES ON COMMON_SECTION TO SMS;

then i tried to make foreign key and it accepted.

anyways thanks

Azhar Mateen
0
 
DarthModCommented:
PAQed with points refunded (500)

DarthMod
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now