$$$ Non-fatal error (1202): Foreign Key 'FCM_1_CO_OWNER(Owner_Id) reference

Hi All,
We are getting below fatal error while repairing the repository. and we are using MDM SP07 Patch Level 27.
Error Message: $$$ Non-fatal error (1202): Foreign Key u2018FCM_1_CO_OWNER(Owner_Id) referencing A2i_CM_Users (UserId)u2019 is missing.
Can  anyone help me how to resolve this issue ?
Thanks & Regards,
Mahesh

Hello,
I guess you have upgraded your system and hence you are getting this error.
I guess some lookup table are missing the reference in this.
But the error says NON-FATAL, please check if you are getting the same error while checking the repository.
My suggestion would be to unmount and mount the reposiory again.
regards,
Abhishek

Similar Messages

  • Received Non-Fatal Error 5904: LV 7 during use of Labview application. What does this mean?

    'Non-Fatal Error 5904'. LabView 7 application.  'Source: Comm Analyzer - CP Analog - Adjust Input Level.vi:CP RX Audio Muting.vi'  (MRTE 3.0 - Anritsu CDMA Test System)
    What does this mean?
    /BCU002
    Hardware Engineer•Design Reliability/Performance and Validation Group•Wavecom, Inc. - Research Triangle Park, N.C.•http://www.wavecom.com

    Xaq,
    Here is the comment that was passed about the error source: Comm Analyzer - CP Analog - Adjust Input Level.vi:CP RX Audio Muting.vi
    The application has been working fine for about 12 years, it continues to serve its purpose and the RF test equipment rack components are now obsoleted by newer models but it's still in weekly use and is kept calibrated annually but on occasion it unexpectedly throws an error like this while I'm using the test rack during a wireless RF parametrics test and it leaves me wondering if the root cause is the device under test or the test rack.  That's why I was hoping to find a detailed description about the error code.
    /Bruce
    /BCU002
    Hardware Engineer•Design Reliability/Performance and Validation Group•Wavecom, Inc. - Research Triangle Park, N.C.•http://www.wavecom.com

  • OER Applet Error - A non-fatal error occurred when fetching an entity id

    Suddenly I have a problem when I want to run 'graphic representation of related items' applet from Oracle Enterprise Repository 11.1.1.2. Thinkmap console shows up wit following message:
    Error: A non-fatal error occurred when fetching an entity id :  : Remote Error: Login required to view information.
    Error: A non-fatal error occurred when loading entities :  : Remote Error: Login required to view information.
    Error: cannot set initial center entity : java.lang.NullPointerException
    I suspect it's some issue with JRE, since everything worked fine few weeks ago. I've also tried to downgrade to JRE 1.5, but I still get the same error. I've tured on debugging and in java console I get this:
    Trace level set to 5: all ... completed.
    basic: Starting applet teardown
    basic: Finished applet teardown
    basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@16aa42e
    basic: Applet loaded.
    basic: Applet resized and added to parent container
    basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 762277 us, pluginInit dt 123357325 us, TotalTime: 124119602 us
    +network: Cache entry not found [url: http://somesrv.domain.si:7101/oer/thinkmap/gui.jsp, version: null]+
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/gui.jsp with proxy=DIRECT
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/gui.jsp with cookie "flashline.authtoken=-5cfd1072-1298307490b--7ff5; flashline.userlogin=; flashline.username=user1"
    network: Server http://somesrv.domain.si:7101/oer/thinkmap/gui.jsp requesting to set-cookie with "JSESSIONID=tbGzMsGDKnnn5pRnK9B9vT1TMf7PKLljxnpJHjVBcQLpnLLBnlhf!835222537; path=/; HttpOnly"
    basic: Applet initialized
    basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@16aa42e
    basic: Applet made visible
    basic: Starting applet
    basic: completed perf rollup
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/my.tas with proxy=DIRECT
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/my.tas with cookie "flashline.authtoken=-5cfd1072-1298307490b--7ff5; flashline.userlogin=; flashline.username=user1"
    basic: Applet started
    basic: Told clients applet is started
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/my.tas with proxy=DIRECT
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/my.tas with cookie "flashline.authtoken=-5cfd1072-1298307490b--7ff5; flashline.userlogin=; flashline.username=user1"
    network: Server http://somesrv.domain.si:7101/oer/thinkmap/my.tas requesting to set-cookie with "JSESSIONID=GVQ8MsGDGTzVGyQTn81n2wQ6hsLJB1p0GBwQD8VhnJJKhr3glNdt!835222537; path=/; HttpOnly"
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/my.tas with proxy=DIRECT
    network: Connecting http://somesrv.domain.si:7101/oer/thinkmap/my.tas with cookie "flashline.authtoken=-5cfd1072-1298307490b--7ff5; flashline.userlogin=; flashline.username=user1"
    network: Server http://somesrv.domain.si:7101/oer/thinkmap/my.tas requesting to set-cookie with "JSESSIONID=LdmyMsGDmRt4CQlw6KKxprRVF0KGMXxjpr38h2dRnYGnTNp2jx5J!835222537; path=/; HttpOnly"
    Browse tree doesn't work either..message in Java console is:
    +network: Cache entry not found [url: http://somesrv.domain.si:7101/oer/com.flashline.cmee.servlet.enterprisetab.AssetTree?depth=2&top=true&cattypeid=100&registrationstatus=100&target=results, version: null]+
    network: Connecting http://somesrv.domain.si:7101/oer/com.flashline.cmee.servlet.enterprisetab.AssetTree?depth=2&top=true&cattypeid=100&registrationstatus=100&target=results with proxy=DIRECT
    network: Connecting http://somesrv.domain.si:7101/oer/com.flashline.cmee.servlet.enterprisetab.AssetTree?depth=2&top=true&cattypeid=100&registrationstatus=100&target=results with cookie "flashline.authtoken=-5cfd1072-1298307490b--7ff5; flashline.userlogin=; flashline.username=user1"
    network: Server http://somesrv.domain.si:7101/oer/com.flashline.cmee.servlet.enterprisetab.AssetTree?depth=2&top=true&cattypeid=100&registrationstatus=100&target=results requesting to set-cookie with "JSESSIONID=HxQCMsKTpGpv3Wrr2vhqHWK06pDR4tpk6QjC1BWJyYSsP7TwLvlJ!835222537; path=/; HttpOnly"
    Anybody has an idea what is wrong and how to resolve this problem.
    Thnx in advance.
    Edited by: Teki on 7.7.2010 10:19

    I figured out what is causing this problem: When connecting OER with LDAP according to documentation (http://download.oracle.com/docs/cd/E15523_01/doc.1111/e16580/extauth.htm#CEGHHGAG ) you have to disable cookie login functionality. Now i figured that 'graphic representation of related items' and 'browse tree' applets are not working if there is no cookie for user. So in order for those two applets to work I have to enable enterprise.security.cookielogin.allow and enterprise.authentication.ldap.enabled (or manually check the Enable automatic Login box).
    Is there any other setting or workaround that would ensure that mentioned applets would work properly without enable automatic login option checked?! And what is the problem if I do have LDAP authentication and cookie login enabled (why is explicitly stated in documentation that I should disable cookie login with LDAP authentication?) Can someone from Oracle clarify this please?
    Edited by: Teki on 7.7.2010 11:43

  • Error making Foreign Keys

    Hi,
    I get an error trying to create foreign keys.
    The message reads "Parent keys not found".
    I have the primary keys in my parent table.
    Any thoughts what it could be?
    Thanks,

    Hi All,
    Please check this:
    ORA-02298 cannot validate (string.string) - parent keys not found
    Cause: An ALTER TABLE ENABLE CONSTRAINT command failed because
    the table has orphaned child records.
    Action: Make sure that the table has no orphaned child records before issuing
    an ALTER TABLE ENABLE CONSTRAINT command. For more information
    about ALTER TABLE and ENABLE CONSTRAINT, see the Oracle9i SQL
    Reference.
    Peter D.

  • Unable to choose foreign key when creating reference partition

    Hello
    I have 2 foreign keys on a table. I am trying to choose the 2nd foreign key when creating a reference partition. I am unable to select the required foreign key.
    The model has Table A -> Table B -> Table C. Table A has a list partition. Table B is the child of Table A. I created a reference partition on Table B. Table C is child of Table B. There are 2 FKs on table C. I am unable to choose the required FK to create reference partition on table C.
    SQL Developer version - 3.0.0.665
    Any help would be appreciated.

    Hi,
    The FK that can be selected is normally the oldest FK that was created for the Table.
    So one option would be to delete and then recreate the FK that is selectable. This process may need to be repeated if there are several FKs that are "older" than the one you wish to use for Reference Partitioning.
    David

  • Non Fatal error while starting oc4j

    We are using oc4j 1.0.2.2.1 and jdk version 1.2.2_007
    While starting oc4j, we get the following error
    A nonfatal internal JIT (3.10.107(x)) error 'Relocation error: NULL relocation target' has occurred in :
    'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method.
    Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi
    Warning: Error reading transaction-log file (/D:/j2ee/home/persistence/transaction.state) for recovery: premature end of file
    Forced or abrubt (crash etc) server shutdown detected, starting recovery process...
    Recovery completed, 0 connections committed and 0 rolled back...
    Oracle9iAS (1.0.2.2.1) Containers for J2EE initialized
    How do we overcome this error.
    this dosent affect any other operations of the server. Moreover this error does not happen when we use
    jdk 1.3.X versions
    Regards
    Hari

    Hari -- This is a known JVM bug and it is harmless. You may either ignore it or move to the 1.3 JVM.
    Thanks -- Jeff

  • Javai.dll non-fatal error

    I installed WebLogic 5.1 (with SP6) on NT 4 and when I try to run it as a
    service, I get "javai.dll not found in specified path" error. After I click
    OK, it seems to run ok.
    I also noticed the message
    "Warning: JIT compiler "symcjit" not found. Will use interpreter."
    at the top of the scrolling text when I run WebLogic from the menu.
    Any ideas?
    Thanks,
    Dave Mrozek

    Dave
    Did anyone ever respond to your inquiry?
    During performance/load testing I have been encountering Dr. Watson errors
    with WebLogic 5.1 sp6 on Windows NT 4 with JDK 1.2.2. BEA support suggested
    that I upgrade to Sunsoft SDK 1.3 to get rid of the Dr. Watson errors that
    and now I am seeing the same messages that you did when I start WebLogic
    server from the DOS command line.
    From what I know, javai.dll was included in JDK 1.1.7, but is not packaged
    with JDK 1.2.2 or JDK 1.3. Even though I used wlconfig to change from JDK
    1.2.2 to JDK 1.3, when I run wlserver from the DOS command line, something
    internal to WebLogic must not be recognizing JDK 1.3 and defaulting to JDK
    1.1.7. But messages generated during WebLogic startup don't seem to
    indicate that this is the problem.
    java.awt.fonts =
    java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob = sun.awt.windows.WPrinterJob
    java.class.path =
    d:\weblogic\lib\weblogic510sp6boot.jar;d:\jdk1.3\jre\lib\rt.jar;d:\jdk1.3\jr
    e\lib\i18n.jar;d:\weblogic\classes\boot;d:\weblogic\eval\cloudscape\lib\clou
    dscape.jar
    java.class.version = 47.0
    java.compiler = symcjit
    java.ext.dirs = d:\jdk1.3\jre\lib\ext
    java.home = d:\jdk1.3\jre
    java.io.tmpdir = C:\TEMP\
    java.library.path =
    java.protocol.handler.pkgs = weblogic.utils|weblogic.utils
    java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition
    java.runtime.version = 1.3.0-C
    java.security.manager =
    java.security.policy = =d:\weblogic\weblogic.policy
    java.specification.name = Java Platform API Specification
    java.specification.vendor = Sun Microsystems Inc.
    java.specification.version = 1.3
    java.vendor = Sun Microsystems Inc.
    java.vendor.url = http://java.sun.com/
    java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
    java.version = 1.3.0
    java.vm.info = native threads, nojit
    java.vm.name = Classic VM
    java.vm.specification.name = Java Virtual Machine Specification
    java.vm.specification.vendor = Sun Microsystems Inc.
    java.vm.specification.version = 1.0
    java.vm.vendor = Sun Microsystems Inc.
    java.vm.version = 1.3.0-C
    The message about "symcjit" results from the WebLogic property
    java.compiler=symcjit in the wlconfig. I think that this needs to be
    changed to java.compiler=javac with JDK 1.3, since BEA indicates that JIT
    should be turned off for JDK 1.3.
    I'd be curious what you did to get around these errors.
    John J. Feigal Voice (651)766-8787 (main)
    Sr. Technical Consultant (651)766-7249 (direct)
    Ensodex, Inc. Fax (651)766-8792
    4105 N. Lexington Ave., Suite 150 email [email protected]
    Arden Hills, MN 55126 WebSite http://www.ensodex.com
    "Dave Mrozek" <[email protected]> wrote in message
    news:[email protected]...
    I installed WebLogic 5.1 (with SP6) on NT 4 and when I try to run it as a
    service, I get "javai.dll not found in specified path" error. After Iclick
    OK, it seems to run ok.
    I also noticed the message
    "Warning: JIT compiler "symcjit" not found. Will use interpreter."
    at the top of the scrolling text when I run WebLogic from the menu.
    Any ideas?
    Thanks,
    Dave Mrozek

  • SOLVED: Totem non-fatal errors - abundant in log

    Xfce4 64-bit w/Totem errors on startup:
    GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
    (totem:1900): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    (totem:1900): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
    (totem:1900): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    (totem:1900): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
    (totem:1900): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    (totem:1900): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
    (totem:1900): Totem-CRITICAL **: totem_object_get_ui_manager: assertion `TOTEM_IS_OBJECT (totem)' failed
    (totem:1900): Gtk-CRITICAL **: gtk_ui_manager_remove_ui: assertion `GTK_IS_UI_MANAGER (manager)' failed
    (totem:1900): Gtk-CRITICAL **: gtk_ui_manager_remove_action_group: assertion `GTK_IS_UI_MANAGER (manager)' failed
    UPDATE: Not really solved, but I removed totem, and totem-plugin , and I installed gnome-mplayer and gecko-mediaplayer
    Last edited by Kilzool (2011-05-26 16:26:21)

    Xfce4 64-bit w/Totem errors on startup:
    GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
    (totem:1900): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    (totem:1900): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
    (totem:1900): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    (totem:1900): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
    (totem:1900): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    (totem:1900): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
    (totem:1900): Totem-CRITICAL **: totem_object_get_ui_manager: assertion `TOTEM_IS_OBJECT (totem)' failed
    (totem:1900): Gtk-CRITICAL **: gtk_ui_manager_remove_ui: assertion `GTK_IS_UI_MANAGER (manager)' failed
    (totem:1900): Gtk-CRITICAL **: gtk_ui_manager_remove_action_group: assertion `GTK_IS_UI_MANAGER (manager)' failed
    UPDATE: Not really solved, but I removed totem, and totem-plugin , and I installed gnome-mplayer and gecko-mediaplayer
    Last edited by Kilzool (2011-05-26 16:26:21)

  • Non-Fatal Run-time Error "%%s"

    This was shown yesterday by an non-debug program written with CVI 9.01 and run-time 9.1 (the current "428" build) on the target.
    I was trying to fix "-12: Out of memory" popups (maybe a race condition inside ProcessSystemEvents/GetUserEvent?) and now this.
    Any idea what this is?
    /* Nothing past this point should fail if the code is working as intended */

    A couple updates:
    From all indications, this dialog should only be shown if your binary (exe) is built in release mode.  If you build in debug mode, you should be able to see the error message that is trying to display.  Also, if our preliminary investigation is correct, the error should be in your release mode exe, and not any loaded dlls.
    From all indications, this dialog should only be shown if your binary (exe) is built in release mode and loads dlls that are build in debug mode.  If you build your dependencies in release mode, no dialog should be displayed at all (because this is a non-fatal error).
    Are you able to verify these statements?
    Thanks -
    NickB
    National Instruments

  • Foreign Key Error script Generation

    here is
    CREATE table script
    create table employee_history
    (empl_id_hist number,
    empl_name varchar2(20)
    alter table employee_history
    add constraint emp_TO_empHIST foreign key (empl_id_hist)
    references employee (empl_id);
    Create table employee
    (empl_id number,
    ename varchar2(20));
    some empl_id_hist values not in Master table employee.
    now Foreign Key disabled.
    for checking not valid empl_id_hist ids
    I am trying to generate a script like this using Dynamic SQL.
    select unique empl_id_hist from employee_history
    where empl_id_hist not in (select empl_id from employee);
    but i am getting same Column empl_id_hist (instead of empl_id ) in Subquery too
    i.e
    select unique EMPL_ID_HIST from employee_history
    where EMPL_ID_HIST not in (select EMPL_ID_HIST from employee);
    DECLARE
    CNT NUMBER := 0;
    V_SQL_STR VARCHAR2(255);
    v_col_name VARCHAR2(255);
    v_ind CHAR(1);
    v_sql_where VARCHAR2(255);
    CURSOR C1 IS
    SELECT DECODE(c.position, 1, b.table_name, ' ') MASTER_TAB,
    DECODE(c.position, 1, a.table_name, ' ') CHILD_TAB,
    DECODE(c.position, 1, a.constraint_name, ' ') constraint_name,
    c.column_name colname
    from dba_constraints a,dba_constraints b, dba_cons_columns c
    where a.status = 'DISABLED'
    AND a.constraint_type = 'R'
    AND a.constraint_name = c.constraint_name
    and a.r_constraint_name = b.constraint_name (+)
    order by b.table_name, a.table_name, c.position;
    CURSOR c2(cons_name VARCHAR2) IS
    SELECT column_name FROM User_Cons_Columns
    WHERE constraint_name = cons_name
    ORDER BY column_name;
    BEGIN
    FOR R1 IN C1 LOOP
    v_col_name := '';
    BEGIN
    FOR r2 IN c2(r1.constraint_name) LOOP
    cnt := cnt + 1;
    IF cnt <= 1 THEN
    V_ind := 'y';
    V_SQL_sTR := 'SELECT UNIQUE A.'||R1.colname ||' FROM ' ||R1.CHILD_TAB ||' A' || chr(10);
    V_SQL_STR := V_SQL_STR ||'WHERE A.'||R1.colname ||' NOT IN ';
    V_SQL_STR := V_SQL_STR || '(SELECT B.'|| R1.colname ||' FROM ' || R1.MASTER_TAB ||' B);' ||chr(10);
    V_COL_NAME := V_COL_NAME || R2.COLUMN_NAME ||',';
    v_Sql_where := 'WHERE A.'||R2.COLUMN_NAME ||' = B.' || R2.COLUMN_NAME ||chr(10);
    ELSE
    v_ind := 'n';
    v_Sql_where := v_Sql_where || 'AND A.'||R2.COLUMN_NAME ||' = B.' || R2.COLUMN_NAME ||chr(10);
    V_COL_NAME := V_COL_NAME || R2.COLUMN_NAME ||',';
    END IF;
    END LOOP;
    v_sql_where := v_sql_where ||');';
    cnt := 0;
    END;
    IF v_ind = 'y' THEN
    DBMS_OUTPUT.PUT_LINE(V_SQL_sTR);
    ELSIF v_ind = 'n' THEN
    v_sql_str := '';
    v_col_name := SUBSTR(v_col_name,1,LENGTH(v_col_name) - 1) || '';
    V_SQL_STR := 'SELECT UNIQUE '|| V_COL_NAME ;
    V_SQL_STR := V_SQL_STR || ' FROM ' || R1.CHILD_TAB || ' A'|| CHR(10);
    V_SQL_STR := V_SQL_STR || 'WHERE NOT EXISTS ( '||CHR(10);
    V_SQL_STR := V_SQL_STR || 'SELECT 1 FROM ' ||R1.MASTER_TAB ||' B';
    DBMS_OUTPUT.PUT_LINE(V_SQL_STR);
    DBMS_OUTPUT.PUT_LINE(V_SQL_WHERE);
    DBMS_OUTPUT.PUT_LINE('');
    END IF;
    v_ind := '';
    END LOOP;
    END;
    thanks in advance

    That's because with this cursor
    CURSOR c2(cons_name VARCHAR2) IS
    SELECT column_name FROM User_Cons_Columns
    WHERE constraint_name = cons_name
    ORDER BY column_name;You assume that the column names are the same in both tables. You will need to read from user_cons_columns twice, once with the fk constraint name, once with the pk constraint name.
    SQL> create table parent (id number constraint parent_pk primary key) ;
    Table cr&eacute;&eacute;e.
    SQL> create table child (child_id number,
      2                      constraint child_fk1 foreign key (child_id)
      3                      references parent (id)
      4                     ) ;
    Table cr&eacute;&eacute;e.
    SQL> select
      2     a.column_name as parent_column_name,
      3     b.column_name as child_column_name
      4   from
      5     user_cons_columns a, user_cons_columns b
      6   where
      7     a.constraint_name = 'PARENT_PK'
      8     and b.constraint_name = 'CHILD_FK1'
      9     and a.position = b.position
    10   order by
    11     a.position ;
    PARENT_COLUMN_NAME             CHILD_COLUMN_NAME
    ID                             CHILD_ID

  • Assigning a foreign key

    i have created a database which is administered by ora1 who created 2 tables called student and instructor then created a new user called dev1 with dba priviliges dev1 created a table called university assigned a primary key to the university_id column and has added new columns to the instructor and student tables owned by ora1 the problem i am having is i am unable to assign foreign keys to the 2 tables owned by ora1 even though dev1 could add the extra university_id columns to the 2 tables the code i am using to add extra columns and assign the foreign keys is as follows:
    alter table ora1.student
    add (university_id varchar2 (5));
    alter table ora1.student add
    constraint student_fk1
    foreign key (university_id)
    references university (university_id)
    on delete cascade;
    I keep getting error message saying table or view does not exist

    hi u are using the right format
    ALTER TABLE <table_name>
    ADD <constraint_name> FOREIGN KEY
    (<column_name1> ,
    <column_name2> )
    REFERENCES <table_name>
    (<column_name1> ,
    <column_name2>)
    ALTER TABLE ora1.student
    ADD student_fk1 FOREIGN KEY
    (university_id)
    REFERENCES university (university_id)the problem may be your table doesnot exist or u are refering the table which is in different schema
    Regards
    Hitesh

  • I am unable to create the Foreign key

    Hi,
    I need to create the Foreign key which reffered to composite primary key.
    the following table structure
    Parent table
    DIVISION, PROJECT_NUMBER, COMPETITION_PROJECT_NUMBER, COMPETITIVE_STMT_TYPE, SEQUENCE, CATEGORY, STATEMENT, USER_ID, RECORD_MODIFICATION_DATE
    Here composite primary key columns(DIVISION, PROJECT_NUMBER, COMPETITION_PROJECT_NUMBER, COMPETITIVE_STMT_TYPE, SEQUENCE)
    Child Table
    DIVISION          VARCHAR2 (4)          
    PROJECT_NUMBER          NUMBER (10)COMPETITION_PROJECT_NUMBER     NUMBER (10)          
    COMPETITIVE_STMT_TYPE          VARCHAR2 (2)          
    SEQUENCE     NUMBER (2)          
    CATEGORY          VARCHAR2 (100)     
    STATEMENT     LONG          
    USER_ID     VARCHAR2 (100)          
    RECORD_MODIFICATION_DATE     DATE     
    ALTER TABLE COMPETITION_STMT ADD (CONSTRAINT COMPET_STMT_FK_PROJ_NUM foreign key
              (PROJECT_NUMBER) REFERENCES PROD_COMPET_XREF (PROJECT_NUMBER));
    when i am trying to create foreign key i got this error
    ORA-02270: no matching unique or primary key for this column-list
    this is production issue Please help me.
    Thanks in advance
    Regards
    Kumar.s

    ALTER TABLE PROD_COMPET_XREF ADD (
    CONSTRAINT PROD_COMP_XREF_PK_DPNCPNCT
    PRIMARY KEY
    (COMPETITION_PROJECT_NUMBER, PROJECT_NUMBER, DIVISION, PRODUCT_LOC_INDICATOR)
    When you create a foreign key, it must reference a unique or primary key. The primary or Unique key must consist ONLY of those columns upon which the Primary key is based.
    You must Alter the table and add a Unique key if you want to keep your compsite primary key constraint. The Unique key must be for only the column that your foreign key references. Then try to recreate your foreign key.
    I doubt you will be able to add a foreign key because I suspect you might have multiple rows with the same value for this column based on your composite key; however, if you only intend for the project number to be listed only once and to be unique for each row, then the unique key may work or you may want to revist your primary key on this table. Perhaps you don't need it to be a composite PK???
    If you can't work around that, one thing you can do is build a table based just on PROJECT_NUMBER that contains details about the project number and have other tables reference that. That is, if you have multiple rows with the same project number in that table. You may already have one? Perhaps you can build your foreign key to reference that?

  • Foreign key mapped to a unique constraint

    ok here is the issue
    create table parent(col1 char, col2 char);
    alter table parent add constraint pk_parent primary key(col1);
    alter table parent add constraint uk_parent unique(col1,col2);
    insert into parent values('A','7');
    *1 row created.*
    create table child(col1 char, col2 char);
    alter table child add constraint fk_child_parent foreign key(col1,col2) references parent(col1,col2);
    insert into child values('B','4');
    insert into child values('B','4')
    ERROR at line 1:
    ORA-02291: integrity constraint (WILDGOD.FK_CHILD_PARENT) violated - parent key
    not found
    thats what i expect....but
    insert into child values('B',NULL);
    *1 row created.*
    why does it let me do this, i realize its because col2 is NULL but shouldnt it still check for col1 to be in the parent?
    Please clarify, thanks in advance.

    I see the same & am not sure why either.
    SQL> @a
    SQL> create table parent(col1 char, col2 char);
    Table created.
    SQL> alter table parent add constraint pk_parent primary key(col1);
    Table altered.
    SQL> alter table parent add constraint uk_parent unique(col1,col2);
    Table altered.
    SQL>
    SQL> insert into parent values('A','7');
    1 row created.
    SQL> create table child(col1 char, col2 char);
    Table created.
    SQL> alter table child add constraint fk_child_parent foreign key(col1,col2) references parent(col1,col2);
    Table altered.
    SQL>
    SQL> insert into child values('B','4');
    insert into child values('B','4')
    ERROR at line 1:
    ORA-02291: integrity constraint (DBADMIN.FK_CHILD_PARENT) violated - parent key not found
    SQL>
    SQL> insert into child values('B',NULL);
    1 row created.
    SQL>
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

  • How to alter or add foreign key constr to table having child rows or data

    Hi,
    I have a table by name DEPT in which the column DEPTNO is a primary key column and have data in it for all the columns . Now I have a EMP table where in the column DEPTNO is not having any constraint including foreign key constraint too. Now i have data in the EMP table for all the columns . now i would like to add the foreign key constraint to DEPTNO column in the EMP table referencing the DEPTNO column in the DEPT table. Both the table do not have any null values .
    I need to add the foreign key without deleting the data in the EMP table.
    Please advice.
    Regards,
    Vinesh

    Hi,
    I need to add the foreign key without deleting the data in the EMP table.Foreign key constraint can have only those values which are present in the primary key of the parent table or null.
    When your tables are populated with values and then you are adding the constraint then,
    the parent table data is only present in child table or null values.
    Example
    SQL> create table emp_bkp as select * from emp;
    Table created.
    SQL> create table dept_bkp as select * from dept;
    Table created.
    SQL> alter table dept_bkp
      2  add constraint pk_deptno primary key(deptno);
    Table altered.
    SQL> select distinct deptno from emp_bkp;
        DEPTNO
            30
            20
            40
            10
    SQL> select deptno from dept_bkp;
        DEPTNO
            10
            20
            30
            40
            55
    SQL>  alter table emp_bkp
      2   add constraint fk_deptno_bkp foreign key(deptno)
      3    references dept_bkp(deptno);
    Table altered.
    SQL> alter table emp_bkp
      2  drop constraint fk_deptno_bkp;
    Table altered.
    SQL> insert into emp_bkp(empno,ename,deptno) values(142,'Fenny',90);
    1 row created.
    SQL> alter table emp_bkp
      2  add constraint fk_deptno_bkp foreign key(deptno)
      3   references dept_bkp(deptno);
    add constraint fk_deptno_bkp foreign key(deptno)
    ERROR at line 2:
    ORA-02298: cannot validate (SCOTT.FK_DEPTNO_BKP) - parent keys not found
    SQL> update emp_bkp
      2  set deptno=null
      3  where empno=142;
    1 row updated.
    SQL> alter table emp_bkp
      2  add constraint fk_deptno_bkp foreign key(deptno)
      3   references dept_bkp(deptno);
    Table altered.
    SQL> insert into dept_bkp (deptno,dname)values(90,'IT');
    1 row created.
    SQL> update emp_bkp
      2  set deptno=90
      3  where empno=142;
    1 row updated.Twinkle

  • Does a foreign key have to be a primary key

    Hey all.I was checking on the database code written by sambapos.To my surprise, I found a foreign key that is not a primary key anywhere.
    Is that possible?
    If, so why?
    I am really astonished.

    Limitations and Restrictions
    A foreign key constraint does not have to be linked only to a primary key constraint in another table; it can also be defined to reference the columns of a UNIQUE constraint in another table.
    When a value other than NULL is entered into the column of a FOREIGN KEY constraint, the value must exist in the referenced column; otherwise, a foreign key violation error message is returned. To make sure that all values of a composite foreign key constraint
    are verified, specify NOT NULL on all the participating columns.
    FOREIGN KEY constraints can reference only tables within the same database on the same server. Cross-database referential integrity must be implemented through triggers. For more information, see
    CREATE TRIGGER (Transact-SQL).
    FOREIGN KEY constraints can reference another column in the same table. This is referred to as a self-reference.
    A FOREIGN KEY constraint specified at the column level can list only one reference column. This column must have the same data type as the column on which the constraint is defined.
    A FOREIGN KEY constraint specified at the table level must have the same number of reference columns as the number of columns in the constraint column list. The data type of each reference column must also be the same as the corresponding column in the column
    list.
    The Database Engine does not have a predefined limit on either the number of FOREIGN KEY constraints a table can contain that reference other tables, or the number of FOREIGN KEY constraints that are owned by other tables that reference a specific table.
    Nevertheless, the actual number of FOREIGN KEY constraints that can be used is limited by the hardware configuration and by the design of the database and application. We recommend that a table contain no more than 253 FOREIGN KEY constraints, and that it
    be referenced by no more than 253 FOREIGN KEY constraints.
    FOREIGN KEY constraints are not enforced on temporary tables.
    If a foreign key is defined on a CLR user-defined type column, the implementation of the type must support binary ordering. For more information, see
    CLR User-Defined Types.
    A column of type varchar(max) can participate in a FOREIGN KEY constraint only if the primary key it references is also defined as type
    varchar(max).
    Read this article
    http://msdn.microsoft.com/en-us/library/ms189049.aspx
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

Maybe you are looking for

  • Duplicate cluster names in network

    I'm setting up several Weblogic servers for Oracle Forms and Reports. The Portal Forms Reports Discoverer installation/configuration installs managed servers and clusters with default names, and doesn't explicitly configure a unicast channel for the

  • What is branding all about, make it more generic a...

    Nokia and other manufacturers produced great phones. But branding the phones has allowed service providers the opportunity to modify or even disable great features that the phones are capable of. (N95) Some service providers are still only offering V

  • How to move music from one video to another.

    I have two videos.  I want to take the sound off of a video, and delete only the video part.  Then,  put the soundtrack onto another video clip.   I can detach the sound from the video, but if i delete the video, the sound track goes with it.  I can

  • Dumb question about iWork

    Just bought a Mac Mini, and it came with the iWork trial. I plan on purchasing it for full use. I'm not at home w/the Mac Mini, and I noticed that it came with some coupons. Anyone know what they're for? (In other words, do they get you any money off

  • Cannot open Bluetooth Settings HP DV8T-1000

    I am running Windows 7 64-bit. I have the HP DV8T-1000 with built in bluetooth. The software for the bluetooth in installed (in fact I uninstalled and reinstalled it).  Everything says "the device is working properly" however if I right click the blu