• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 650
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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