Posted on 2006-06-03
Last Modified: 2013-12-11
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
Question by:azharmateen
    LVL 16

    Expert Comment

    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);


    Author Comment

    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
    LVL 1

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
    Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now