How can I make sure that changes in a primary key (in the parent table) would also appear directly in the FOREIGN KEY in the child table?

Forgive my question. I am very new to Oracle.

How can I make sure that changes in the key primary supplier_id (concerning the supplier table) would also appear directly in the FOREIGN KEY (supplier_id) in the products table?

Is that not all the primary key and FOREIGN KEY on?

My paintings:

I created 2 tables and connect to apply in the data base referential integrity, as I learned.

CREATE TABLE - parent provider

(the numeric (10) of supplier_id not null,)

supplier_name varchar2 (50) not null,

Contact_Name varchar2 (50).

CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)

);

CREATE TABLE - child products

(the numeric (10) of product_id not null,)

supplier_id numeric (10) not null,

CONSTRAINT fk_supplier

FOREIGN KEY (supplier_id)

REFERENCES beg (supplier_id)

);

I inserted the following text:

INSERT INTO provider

(supplier_id, supplier_name, contact_name)

VALUES

(5000, 'Apple', 'first name');

I expect that the supplier_id (5000) to the provider of the table also appears in the products table under key supplier_id having the same value which is 5000. But this does not happen.

How to get there?

Thanks in advance!

Hello

What is a foreign key in Oracle?

A foreign key is a way to ensure referential integrity in your Oracle database. A foreign key means that the values of a table must appear also in another table.

Ok!??

What is now the right way to implement referential integrity in your Oracle database that the values of a table must also be included in another table?

A foreign key referential integrity indeed enfore in ensuring that the value in the child table must have a corresponding parent key (otherwise you will encounter an error, as evidenced by "SomeoneElse"). However, it will never automatically insert a row in the other table.

If you are looking for a solution that automatically inserts a record in the other table, maybe you should go for triggers:

See:

Tags: Database

Similar Questions

  • How can I make sure that I am not charged for ALL the stuff of cloud?  And please explain to this OLD duffer... How to get the clouds out!

    How do I completely get out of theClouds AND make sure that I'm not going to be charged?

    Hello

    The Adobe Id on the forums has no assets CC membership/registration under him.

    You are not charged for any subscription of cloud under this Adobe ID

    Kind regards

    Sheena

  • How can I make sure that my music on my Ipod Classic is not lost forever, if it breaks down?

    How can I make sure that my library of music on my Ipod Classic is not lost forever, if it breaks down?

    Back it up.

    Your music library should never exist only on your iPod.  It must be present on a computer in iTunes, and to be sure it must be saved on an external drive also.

    If your library no longer exists on your computer for whatever, reason, you need to extract the iPod.

    turingtest2 offers you several ways to do this in his user tip found here:

    Recover your iTunes from your iPod or an iOS device

  • How can I make sure that my kids use no other direct email addresses?

    Summary of the issue
    Other issues of Windows Live family safety

    What version of Windows Live Family Safety do you use?
    Version 2011 (15.4.3538.513)
    Choose your operating system version:
    Windows 7

    Additional details
    My son can connect to her fine Hotmail account, but it can also connect using other Hotmail or Live email addresses. How can I make sure that it can only connect to Hotmail with their family safety account?

    Hi iclay,.

    I have reproduced your concern in our end and I discovered, add other e-mail accounts that he can use and accounts already created by your son in Windows Live family safety and block the Windows Live Hotmail registration page to prevent it from creating an another workaround e-mail accounts.

    To add e-mail as child account in Windows Live Family Safety:

    1. connect your account on http://fss.live.com.
    2. under Family summary, click on Add a new child.
    3. log on to the account of the child

    After that, the child's account appears as a member of the family under the new parent account.

    To block the registration page:

    1. on any computer, connect on the parent account to the safety of the family home page
    2. click Edit settings under the name of your son, and then click Web filtering lists.
    3. enter http://signup.live.com in the box and click on block.
    4. click on Save.

    Please inform us if you have any questions or concerns, we will help you gladly with him.

    Thank you

    Christian C.

  • How can I make sure that any firewalls (versions of software or hardware) does not block port 443 to access?

    How can I make sure that any firewalls (versions of software or hardware) does not block port 443 to access?

    Hi Anna_753,

    Usually, you would receive messages from any program if it is impossible to access the port.

    If you want to check if the port is accessible, then you will need to check the firewall settings.

    Each firewall has its own parameters for ports of the computer.

  • I just upgraded to the Plan complete creative Cloud, but I also had a plan of individual photo, the upgrade to the PAC will cancel the individual level, or what I have to cancel and how can I make sure that I do not get penalized for cancellation?

    I just upgraded to the Plan complete creative Cloud, but I also had a plan of individual photo, the upgrade to the PAC will cancel the individual level, or what I have to cancel and how can I make sure that I do not get penalized for cancellation?

    [Duplicate message deleted... post the same question more than once is confusing... MOD]

    [This is an open forum, not a direct line to Adobe support... you have to wait a response]

    First of all, such that added to your message of origin by a Mod, please do not post the same question twice

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help
    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific time) <==> NOTE DAYS AND TIME

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • I have trouble deleting a project to create Clip... keep it coming back (sync).  How can I make sure that it is void of all devices and permanently?

    I have trouble deleting a project to create Clip... keep it coming back (sync).  How can I make sure that it is void of all devices and permanently?  So much space being taken up on my iPad... there at - it a why to manage what are sync'd projects and ignore others?

    Hi Bill,

    Sorry, you have trouble. Here's a suggestion:

    1. launch Premiere Clip on a device and make sure it is not open on other devices.

    2. on the device, as it is opened, remove projects that are no longer needed.

    3. allow the synchronization of the application (leave opens and is not the bottom) so that projects are marked as being deleted on the service. A circle of rotation icon appears in the lower left corner of your device while synchronization is in progress.

    4. Uninstalling the app on other devices, then re - install and login to leave remaining projects sync.

    Please let us know if this solves your problem, or if you need more help.

    Thank you

    Bronwyn

  • How can I make sure that all components in my opinion have been instantiated to test

    I'm testing a view 'view', which has an ADG but the ADG is null.

    Try this code:

    view.adg.dataProvider = data;

    How can I make sure that all components in my opinion have been instantiated to test?

    private var view: UserManagement;
    [Front]
    public void Setup (): void
    {

    view = new UserManagement;

    }

    [Test]
    public function testSaveData (): void
    {
    var data: collection ArrayCollection = new ArrayCollection();
    for (var i: int = 0; i < 1000; i ++)
    {
    var item: Object = new Object;
    element.isModifiedClientSide = Math.round (Math.random () * 1);
    data.addItem (element);

    }
    view.adg.dataProvider = data;

    }

    You have instantiated your view.  Usually, when I'm working with a view, mine looks like this

    private var myView:MyViewClass;

    [Before(async,ui)]
    

    public void Setup (): void

    {

    Bird = new MyViewClass();

    Async.proceedOnEvent (this, opinion, FlexEvent.CREATION_COMPLETE, 500);

    UIImpersonator.addChild (bird);

    }

    [After]

    public function teardown (): void

    {

    UIImpersonator.removeChild (bird);

    Bird = null;

    }

    Here is a link detailing using display classes in unit tests

    http://docs.FlexUnit.org/index.php?title=UIImpersonator

  • How can I be sure that if I write a frame on the bus with success?

    Hello

    I use XNET to write and read the structure. I wonder how can I be sure that the writing frame on the bus is successful? I mean without using the XNET-monitor or something. Are there any screws or propertynode to set after the XNET Write.vi to let me know if I really write an image in the bus or not?

    THX.

    It's been a while since I looked, but I vaguely remember that (at least with the C of FPGA OR-CAN-modules of the series) there is a function/method/configuration setting that allows to configure the module echo all the (or just the error frames) sent executives to the side of the reception.

    Also, I think you're supposed to be able to assume that if you get an error when writing, she has been sent successfully. (But even I'm not convinced...)

  • The upgrade from Vista to Windows 7: How can I make sure that I keep Microsoft Office

    A few months back I took advantage of this offer to upgrade from Vista to Windows 7 for a discounted price. After that I downloaded the upgrade file, Upgrade Advisor told me that because I'm using Vista business and I was upgrade 7, that my computer would probably be home must pass through with a 'clean install', thus wiping my hard drive.

    That's fine with me, I could just move my documents and Favorites on an external hard drive. But I'm afraid that the upgrade will be wipe my Microsoft Office programs.

    I bought this computer a few years ago. I don't even know if I bought the program with office bundled with it, or if I bought it separately (and probably the discs are somewhere in storage).

    How can I make this update without losing Microsoft Office? Is it possible to confirm if my word has come with my computer or if I installed it separately. If it came with it, and I lose it, certainly there must be a free way for me to recover. Right?

    Any other advice for someone planning on the upgrade?

    Thank you!

    You're the one who knows if you installed Office.

    Office (Word, etc.) comes for free with Windows. you have to buy.

    If Office is preinstalled, it was a test.

    A clean installation will wipe everything.

    You cannot transfer programs.

    It needs to be reinstalled from the original media.

    If you do not have the desktop drive:

    http://support.Microsoft.com/default.aspx/KB/326246

    'How to replace Microsoft software or hardware, order service packs and upgrades, and replace product manuals'

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://social.answers.Microsoft.com/forums/en-us/w7install/threads

    "Download Windows 7 installed and activated on your PC."

    They will help you in the Windows 7 Forum at the above address.

    See you soon.

    Mick Murphy - Microsoft partner

  • Hi, my iphone calendar 6 freezes, how can I make sure that it works correctly?

    My iphone seems to work normally, however I encounter some problems with my calendar that freezes often (I can't use the touch screen to select a date or navigate up and down day).  Anyone know a fix?  My software is up to date (IOS 9.2.1).

    Thank you

    Hello matclav,

    Thank you for using communities of Apple Support.

    I see that your calendar on your iPhone app is cold. Have you tried the following steps:

    Restart the application

    Close the application , and then open it again.

    Restart your device

    Turn your device, then turn it on again.

    Look for the iOS and app updates

    1. Make sure you use the latest version of iOS.
    2. Open the App Store and press updates.
    3. If updates are available, click all to update.
    4. If requested, enter your Apple ID.

    You might need a WiFi update applications.

    These steps are in the following support article:

    If an application you have installed unexpectedly closes, unresponsive, or does not open

    If it still does not work, let know us and we can see what needs to be addressed on the next.

    Best regards.

  • How can I make sure that the automatic renewal is disabled?

    Hello

    As a student; I had the composition cloud creative for some time now, because I am not able to afford it for more than 12 months, I want to be totally assured that my subscription will not get auto-renouvelé when it ends.

    I read in the following guide: disable autorenewal subscription services Adobe PDF

    However, it does not seem to be an option to disable the automatic renewal to 'manage', plan system nor does it display whether I left active.

    I can't really go through another year of my creative cloud membership because I might not EMA (upkeep allowance) to allow it at this time there and can allow me to cancel my subscription. Is there a possible way to make sure my subscription will not get automatically renewed in the end date?

    Cancel see answer #1 in https://forums.adobe.com/thread/2023066 - includes a link to Chat from Monday to Friday

    or

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

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • How can I make sure that my photos are not replicated to infinity?

    I have pictures 1.0.1 installed on a Macbook Pro retina end 2013 running OS X v10.10.5

    I recently found a challenge with my pictures on Mac synchronization with my iPhone 6 reading here, but now I'm stumped.

    I'm at my library of Photos for the first time in a while and I find that I have extra copies of many images. 5 to 8 options many images.  Looking at, a large part of the Meta data is different, which can be partially, at least, due to an incident of erasure and disk recovery that I lived in 2014.

    Looking through these tips, I learned what a vs a managed library referenced and determined I have a managed. I saw where, because of this, deleting photos in Photos should remove the file from the original disc.  This doesn't seem to be the case.

    If my photo library file and my photo files are located on an external drive, rather than the default file structure the startup disk?

    It seems that eliminating extra, superfluous, copies of photos in a library of 20,000 + image could save me disk space, but going through the library, then by all records to research the Extras won't be effective.

    I would like to know that the removal of a photograph of the photo library will eliminate this photo from my HARD drive.  How can I ensure this?

    Any ideas on that?

    Is it possible that you have more than one library of Photos?

    Let's say I photo library 'A' and the first library I have ever created. I then turn on iCloud library ensure those sync up to my iCloud account.

    If I have more than one library of Photos, and I called photo library 'B' as system photo library, it will turn off the iCloud Photo library feature.

    If I go to turn on iCloud photo after photo library 'B' new photo system library, images already synced up my iCloud account of photo library 'A' will merge with the 'B' photo library and may be what is happening here.

  • How can I make sure that I do not continue to receive a daily bombardment of junk emails

    Junk e-mail

    How can ensure me that I do not continue to receive a daily bombardment of junk when emails I brush them every day?  I note that the shippers are often the same despite my allow to delete them immediately.  I ask you, what I would do with an enlargement of the penis when I am a woman?  Please help get rid me of these messages unwanted waste once and for all.  Thank you

    You mark them as spam? If you you do not need that, long term, this will help get out them of your Inbox permanently.

  • How can I make sure that the playback window corresponds to the resolution of the original item?

    Installing just the Premiere Pro on my laptop, I found that reading the timeline main window does not play the video in its correct resolution. This isn't a problem if I want to drag and drop the video clip in the preview window, he plays the clip as it was recorded. How can it be fixed, please?

    Extra: The clip in the timeline playback window seems to zoom in. Even when I select 'Fit', the clip is still extended...

    Your sequence setting is probably not the images.

    What first do you use?

    To get correctly the settings follow these steps:

    The latest version tells you to drag a clip in the timeline to get the appropriate settings.

Maybe you are looking for