You can use the table of exception when you activate a FK constraint?

Anyone know if its possible to use the exception table when you activate a FK constraint? I know that it works to allow a first key constraint, but have not been able to operate to allow a FK constraint. BTW, we use Oracle 11 GR 2.

Works for me.

SQL> create table exceptions
  2  (row_id          UROWID
  3  ,owner           VARCHAR2(30)
  4  ,table_name      VARCHAR2(30)
  5  ,constraint_name VARCHAR2(30));

Table created.

SQL> create table t1
  2  (col1 number not null);

Table created.

SQL> insert into t1 values (1);

1 row created.

SQL> insert into t1 values (2);

1 row created.

SQL> insert into t1 values (1);

1 row created.

SQL> commit;

Commit complete.

SQL> alter table t1 add constraint pk_t1 primary key (col1) exceptions into exceptions;
alter table t1 add constraint pk_t1 primary key (col1) exceptions into exceptions
                              *
ERROR at line 1:
ORA-02437: cannot validate (RIMS.PK_T1) - primary key violated

SQL> select * from exceptions;

ROW_ID                         OWNER    TABLE_NA CONSTRAINT_NAME
------------------------------ -------- -------- ------------------------------
AAB5jpAAWAAH2XTAAC             RIMS     T1       PK_T1
AAB5jpAAWAAH2XTAAA             RIMS     T1       PK_T1

SQL> delete from t1 where rowid = 'AAB5jpAAWAAH2XTAAC';

1 row deleted.

SQL> delete from exceptions;

2 rows deleted.

SQL> alter table t1 add constraint pk_t1 primary key (col1) exceptions into exceptions;

Table altered.

SQL> select * from exceptions;

no rows selected

SQL> create table t2
  2  (col1 number);

Table created.

SQL> insert into t2 values (1);

1 row created.

SQL> insert into t2 values (2);

1 row created.

SQL> insert into t2 values (3);

1 row created.

SQL> commit;

Commit complete.

SQL> alter table t2 add constraint fk_t2 foreign key (col1) references t1 (col1) exceptions into exceptions;
alter table t2 add constraint fk_t2 foreign key (col1) references t1 (col1) exceptions into exceptions
                              *
ERROR at line 1:
ORA-02298: cannot validate (RIMS.FK_T2) - parent keys not found

SQL> select * from exceptions;

ROW_ID                         OWNER    TABLE_NA CONSTRAINT_NAME
------------------------------ -------- -------- ------------------------------
AAB5jsAAWAAIP8rAAC             RIMS     T2       FK_T2

SQL> select * from t2 where rowid = 'AAB5jsAAWAAIP8rAAC';

      COL1
----------
         3

SQL> 

Tags: Database

Similar Questions

  • Can you attribute programmatically size when you use the table in the Cluster service cluster

    I use the table of the Cluster service.  The only way I know to the size of the cluster is to right click on the function and set the Cluster size.  But what happens if the length of my table changes?  Is there a way to make the cluster size is the number of elements in the table?  Seems like labview should do this automatically at run time.  There may be some nodes of property I don't know.

    I tried the SQL statements, but it always boils down to having to know the number of columns is in the database prior to execution.

    What I did to generate the object to be a cluster to match database fields.  My recordset is an array of objects.  Then I a vi member to build a recordset from the database and another Member vi to retrieve an array of clusters of the recordset object.  If the database changes, I have to change the subject and these two vi.  All the other Subvi call these two for the manipulation of data.  No other sub - VI have bundle and ungroup functions in them, only the vi of two members.  Thus a change in the database requires a change of control and two vi.  Not too bad.

    (I'm tooting my Horn in choosing me as accetped solution provider.  I learned this bad habit of others here on the forum.  )

  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

  • When I put the time, she can use the internet, she changes the time on the computer and returns on the internet. What can I do?

    When I put the time, she can use the internet, she changes the time on the computer and returns on the internet.  What can I do?

    Not enough information.  You have provided no context.  You don't say what version of Windows you are using and you don't really describe the situation in many details.  Reading between the lines, it looks like you have a child who has time on the Internet you want to limit.  You do not tell us what tools you use to control this limit online, so it is difficult to recommend the right forum for your post.  Please update your message with a more detailed description of what is happening and what you want to do.

    One thing that comes to mind is using Live Parental control with a Netgear router.  See http://www.netgear.com/lpc.  LPC uses the service OpenDNS (http://www.opendns.com/)

  • Im trying to fill the network so my ps2 connections can use the signal wireless to my laptop running vista Basic. When I click to bridge, I get a message saying that I need at least 2 internet connections. is this in any way about this?

    Im trying to fill the network so my ps2 connections can use the signal wireless to my laptop running vista Basic. When I click to bridge, I get a message saying that I need at least 2 internet connections. is this in any way about this?

    Hi Jer9009,

    Welcome to the Microsoft answers site.

    ·         Could you give the exact error code or error number you get?

    To connect multiple computers, install a network adapter in each and run a network CAT5 cabling to connect each one to a hub (and thus the other.) The computer that will serve as a transition will have a standard network card for wired and a wireless network adapter that will connect to the wireless (WAP) access point or gateway on the second network.

    A network bridge is software or hardware that connects two networks or more so that they can communicate. You can create only a single bridge network on a computer, but a bridge can handle any number of network connections.

    For more information, see the link: create a network bridge:http://windows.microsoft.com/en-US/windows-vista/Create-a-network-bridge

    Add a connection to a network bridge: http://windows.microsoft.com/en-us/windows-vista/Add-a-connection-to-a-network-bridge

    Swathi B - Microsoft technical support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Windows Search 4 the program active with a log on before you can use the start menu. It is sometimes impossible to open an Office application.

    Original title: search Windows 4

    With Windows Search 4, the program active at the log on before you can use the start menu. Several search screens occur and reproduce when they are closed. Sometimes it's impossible to open an Office, research childcare opening application.

    Hi Ken_978,

    ·         How long have you been faced with this problem?

    ·         Did you do changes on the computer before the show?

    ·         The question is only limited to Office applications?

    ·         What exactly happens when you try to open an Office application? You receive an error message?

    Follow the suggestions below for a possible solution:

    Method 1: I suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malware

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: While running scan on the hard drive if bad sectors are found on the hard drive when scanning try to repair this area if all available on which data may be lost.

    Method 2: If this does not help then you can uninstall and reinstall Windows search 4.0 on the computer.

    Follow the steps below to uninstall:

    a. click on Start

    b. click Control Panel

    c. select Add / Remove Program

    d. place a check on "Show updates"

    e. you will see Windows Desktop Search 4.0 and uninstall it.

    Reinstall back, you can see the link below:

    http://www.Microsoft.com/Windows/products/winfamily/desktopsearch/choose/windowssearch4.mspx

    Hope this information helps.

  • I am a student in the United Kingdom, and my account Adobe said that my adobe creative cloud subscription has expired so I can't use the software. However when I access my account through "onthehub" he told me that the same subscription has not expired. P

    I am a student in the United Kingdom, and my account Adobe said that my adobe creative cloud subscription has expired so I can't use the software. However when I access my account through "onthehub" he told me that the same subscription has not expired. Help, please?

    Your subscription to cloud shows correctly on your account page?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    If you have more than one email, you will be sure that you use the right Adobe ID?

    .

    If Yes

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    .

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • Is there a limit on the number of times you can use the recovery CD

    I have a desktop a6242n and the failed hard drive, I installed a new and inserted the recovery CD and it comes up with the message that this is not the correct CD for this computer. I made them when I first got the computer and used without problem. Is there a limit on the number of times I can use the recovery CD? If I buy a new game that will work?

    Hello

    There is no limit to how many times you can perform a recovery from the discs. The issue is likely because the hard drive does not have DMI information loaded on it. You will perhaps call HP and order a set of recovery disks and ask them to guide you through access to tools on the recovery disk to reload this information on the disc, assuming they are available.

    Good luck!

  • You can use the style of reference R1C1 for SpreadsheetSetCellFormula

    I'm setting up a spreadsheet where I want the sum of some columns appear at the end of the line.  The problem is that the number of columns can vary according to when the report is run.

    A function SpreadsheetSetCellFormula is written like this for summing columns B through D and placing the function in column 5 (E).

    < CFSET curRow = 2 >

    < CFSET curCol = 5 >

    < CFSET SpreadsheetSetCellFormula (sObjRollUp, "SUM(B2:D2)", curCol, curRow) >

    But what happens if there are 10 columns, or 15 columns?

    I tried and it doesn't work with the R1C1 reference style:

    < CFSET SpreadsheetSetCellFormula (sObjRollUp, "SUM (#curRow #C #curCol R - 4 #: R #curRow #C #curCol - 1 #)", news line, curCol ") >

    But that generates an Excel error.

    I know (in Excel), if I turn R1C1 reference I can reference range a sum like this: = SUM(R6C2:R6C3), but if the R1C1 reference is disabled, this feature will not work.

    If a couple of questions.

    (1) is there a CF or Excel function to get the value of the 'LETTER' of a numeric column value (remember column, AA, AB, etc.).

    OR

    (2) is it possible CF to turn R1C1 making reference to the spreadsheet object.

    I could be wrong, but I don't think that CF supports the R1C1 style.  However, you can use the underlying classes POI to convert a number of columns in a letter. Just be aware POI expects the index column to base zero, not one.

    example of generating all the letters in column

    util = createObject ("java", "org.apache.poi.ss.util.CellReference");

    for (col = 1; col<= 256;="" col++)="">

    Note: the numbers of the columns are zero-based (0)!

    colLetter = util.convertNumToColString (col - 1);

    WriteOutput ("R1C1 = [#col #] Alpha = [#colLetter #]")
    " );

    }

    Post edited by: == cfSearching == -.

  • I just bought an Iphone 6s and not yet am possession of en from the Sim Card. Ook, do you know if I can use the phone including applications via Wifi and put the chip later? Thank you. Renault JL

    I just bought an Iphone 6s and not yet am possession of en from the Sim Card. Ook, do you know if I can use the phone including applications via Wifi and put the chip later? Thank you. Renault JL

    No, because if you bought a new iPhone, then you need a SIM card to activate it before you can use the wifi applications.

    This is a phone after all, you don't need a sim card any to be able to activate it.

  • You can use the new magic keyboard with Apple TV 4Gen?

    You can use the new magic keyboard with Apple TV 4Gen?

    The ATV4 does not support any Bluetooth keyboard. You can use the Apple TV iOS with her application.

  • I have XP pro and you want to connect to the MSN remote connection that uses my computer through my D Link router so that I can use the router to connect a tablet.

    How D link to connect to the modem connection

    I have XP pro and you want to connect to the remote connection MSN my computer use through my D Link router so that I can use the router to connect a tablet like Kindle Fire.

    Hi Bob,

    You can follow this link & check if it helps:

    How to set up and use remote connections in Windows XP?

    Internet Connection Wizard


    Reference:
    How to configure Internet access in Windows XP Professional?

    Hope the helps of information.

  • You can use the same connection to mobile broadband on your laptop & a smart phone?

    You can use the same connection to mobile broadband on your laptop & a smart phone?  IE, exchange between one & the other not use both at the same time?

    Hello

    I suggest you according to the question in this forum and check if that helps:

    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking

    It will be useful.

  • You can use the ZyXEL NBG-419N router in windows xp

    You can use the ZyXEL NBG-419N router in windows xp

    Hello

    The real question is to know if your wireless device is compatible which should be it that this router has also B and G
    capabilities. Check the Support and the Documentation of ZyXEL. If you think there may be problems (would be unusual)
    Check with the manufacturer of your device WiFi support and documentation.

    ZyXEL NBG-419N
    http://us.ZyXEL.com/products/details.aspx?PC1IndexFlag=20040520161256&CategoryGroupNo=2F39BF6F-E115-4047-A6C9-36833483A7CA

    One of the first things I do with a router is updates of the firmware.

    I hope this helps and happy holidays!

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • BlackBerry Smartphones using the trackpad to zoom when you take pictures of BB Bold 9700

    I'm used to be able to use the trackpad to zoom when taking pictures or recording videos.  It has suddenly stopped and I can't understand why.  Can anyone help please?

    With the BlackBerry device powered time, remove battery for a few seconds and then reinsert the battery to restart.

Maybe you are looking for

  • Importing photos made duplicate photos

    Hello I am having trouble with the Photos app each time that I plug in my phone, it asks me to import new photos (as usual), but this import include SOME photos (24) I already imported. So, every time I import I get a copy of the same 24 photos. Yes,

  • Audio on Compaq CQ58

    I am having some problems with the sound on my Compaq. If I go to Device Manager and disable then enable the audio display intel and realtek HD audio sound SOMETIMES then comes back, but not always. Does anyone know how to fix this?

  • No audio output because High Definition Audio Driver cannot start (Envy 17 Quad) HDMI

    Since I bought this laptop two months ago, the HDMI audio has always been inconsistent. I remember working once or twice, but there were several times when my audio driver recognizes that an HDMI cable is connected. Yes, I tried everything that is ob

  • TouchSmart iq816 hibernation / sleep not working right

    I had to have the hard drive replaced.  Everything works on my system, but the Hibernate / sleep doesn't really seem to be getting into the appropriate mode.  I think it is just turn off the monitor.  Ambient light remains on, the reader, in my view,

  • HP Pavilion n221sa-15 PC Notebook touch pad frequently glitching

    HP Pavilion n221sa-15 Notebook PC, windows, 8.1, 8 GB of ram (7.89 usable), OS 64-bit, processor 1.80 GHz intel core i3 I got my new laptop I bought recently (3-4 weeks, more or less) and I noticed that my touchpad we OFTEN acting upward. Sometimes,