How to insert into two differents tables at the same time

Hi
I'm newer using JDev, (version 3.1.1.2 cause the OAS seems to support just the JSP 1.0)
and I want to insert into two differents tables at the same time using one view.
How can I do that ?
TIA
Edgar

Oracle 8i supports 'INSTEAD OF' triggers on object views so you could use a process similar to the following:
1. Create an object view that joins your two tables. 'CREATE OR REPLACE VIEW test AS SELECT d.deptno, d.deptname, e.empname FROM DEPT d, EMP E'.
2. Create an INSTEAD OF trigger on the view.
3. Put code in the trigger that looks at the :NEW values being processed and determines which columns should be used to INSERT or UPDATE for each table. Crude pseudo-code might be:
IF :NEW.deptno NOT IN (SELECT deptno FROM DEPT) THEN
INSERT INTO dept VALUES(:NEW.deptno, :NEW.deptname);
INSERT INTO emp VALUES (:NEW.deptno, :NEW.empname);
ELSE
IF :NEW.deptname IS NOT NULL THEN
UPDATE dept SET deptname = :NEW.deptname
WHERE deptno = :NEW.deptno;
END IF;
IF :NEW.empname IS NOT NULL THEN
UPDATE emp SET empname = :NEW.empname
WHERE deptno = :NEW.deptno;
Try something along those lines.
null

Similar Messages

  • How can I log into two differant accounts at the same time in two windows without the second window affecting the first.

    I'm trying to log into two facebook accounts at the same time in differant windows. When ever I log into the second account in the second window it changes the login in the first window. When I hit home or any other link the first window account has been logged out and logged into the second window account. I tried installing a second copy of firefox in a differant folder that the first but it seems to use all the files of the first installation. If I can get 2 toatally seperated instalations that don't rely on the same history, cookies, cache, etc I belive that will solve my problem. Please help.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)

    Nah, that won't work. Facebook has a feature that gets your IP Address, so as soon as you sign into one on the same computer, it changes the other login for safety purposes (say, someone was on a public library PC. They forgot to log out. Someone else logs in, and it automatically logs them out). You'll need 2 computers to do that.

  • How to sync with two computers not at the same time, I'm registerd with one computer

    How to sync with two computers (not at the same time), I'm registered with one computer and am trying to connect with second computer with same iPhone. To sync the first time with the second PC "Firefox Sync Option tells me Create New account or Connect, when I connect it gives me a Passcode and on iPhone it also gives me a Passcode, than how do I connect? Both the iPhone and PC gives me a Passcode and have now idea what to do with them.
    Where do I find my Sync Key ? so I can install manually if it works ?

    Use the Sync Key ''(Recovery Key)'' from the PC that you used to initially setup your Firefox Sync service, when setting up that 2nd PC with Sync. You need to use '''Add a device''' to setup the 2nd and subsequent devices on a Sync account. <br />
    https://support.mozilla.com/en-US/kb/add-a-device-to-firefox-sync

  • How can I have two PDFs open at the same time next to each other?

    How can I have two PDFs open at the same time next to each other?

    Moved to Adobe Reader for iOS.
    The only way I know how to do that is with two iPads.

  • How do I get two screens up at the same time

    Hello.
    How do I bring up two screens at the same time so I can work on one and refer to the tutorials on the other?

    Hello Jazzy6491
    All you should need is another monitor and the appropriate adapter for it you plug into you MacBook Pro. Check out the article below on how to use multiple monitors with your Mac.
    OS X: How to use multiple displays with your Mac in Mountain Lion and earlier
    http://support.apple.com/kb/ht5019
    Regards,
    -Norm G.

  • How do I display two open sites at the same time on screen instead of switching between tabs?

    I need to open two different websites using Firefox. They appear as tabs, but I can only view one tab at a time and continually have to switch back and forth. I need to have both separate websites open and displayed simultaneously on the screen. Is there a way to do this or an add-on that will support multiple open windows on screen?

    You can open all the pages in separate windows and resize and position the windows horizontally or vertically to have them both visible at the same time.
    Note the you can drag a tab slightly downward in the browsing window to tear off the tab or use the right-click menu of the tab (Move to New Window).

  • ITunes loads into two winxp profiles at the same time...

    Well I just installed itunes.. For some reason if my gf's profile is signed in and I start itunes.. itunes opens up in her profile as well as mine... but when i switch to her profile the itunes window says that itunes already running.
    if i start itunes under her profile this does not happen.
    this only happens when I start itunes on my profile.
    has anyone else experienced this or know how to solve this problem???
    I installed itunes under my profile.
    Note:
    I also noticed that if i open and close the pref window another instance of itunes shows up under my gf's profile in the task manager. it only shows up after i close the window.
    Message was edited by: dshade

    but can both users be logged in on to winxp??
    Because my issue is that when I open itunes, itunes also opens on my gf's profile within 2 secs of itunes being open. and everytime i open the pref window or some sort of window pops up another instance of itunes opens on my gf's profile. so i would either have to switch to my gf's profile and dismiss all the you can only have one instance of itunes open windows or i have to kill the process in the task manager
    my gf doesn't use itunes at all since we don't own an ipod and she dosen't listen to music on the computer, and i am only using it for the store.

  • How do I put two devices online at the same time?

    Hi, I have just bought the Wireless-G Broadband Router, model #WRT54G. I have everything working except I'm having one little problem. I can only go online with one thing at a time. Once I'm using my computer the PS3 shuts down the internet then vise versa.
    How can I make it so I can go online with the PC while playing online with the PS3. Is there something else I'm needing to buy?
    Message Edited by Nikko1 on 05-08-2008 02:15 PM

    I am having a similar problem.  After doing to searching I cam accross this blog:
    http://maikelv.be/blog/2007/10/27/ps3-and-linksys-wrt54g-the-solution-2/#more-9
    From reading it and the comments it sounds like this is our problem and the solution.
    I will be trying it tonight, hopefully it works.

  • How do I have two apps open at the same time on full screen?

    As above - I want to work on word and the internet at the same time. I have resized the screens to half but would like them both to be on full screen. I did manage to do this by accident once (I think) so I'm sure it can be done!!

    Lion I think - it's the new mac air?

  • How do I divide a large catalogue into two smaller one on the same computer?

    How can I divide a large catalogue into two smaller ones on the same computer?  Can I just create a new catalogue and move files and folders from the old one to the new one?  I am using PSE 12 in Windows 7.

    A quick update....
    I copied the folder in ~Library/Mail/V2/Mailboxes that contains all of my local mailboxes over to the same location in the new account. When I go into mail, the entire file structure is there, however it does not let me view (or search) any of the messages. The messages can be accessed through the Finder, though.
    I tried to "Rebuild" the local mailboxes, but it didn't seem to do anything. Any advice would be appreciated.
    JEG

  • Updating two tables at the same time

    Please,
    Does someone have an idea on how to update two tables at the same times?
    Thanks a lot in advance

    I was thinking about a single session and single update command.
    That's why I thougth someone else could have a clue.
    Thank you

  • How do i sync two different ipads to the same computer, but maintain two seperate list of apps?

    How can I sync two seperate ipads to the same computer without the apps from one ipad being loaded on the other?

    Do this for each device. You can do this with all iTunes content as well. Apps, music, photos, books, movies - everything. You can have unique content on all of your devices.
    You may also want to turn off auto sync so that you do not have to wait for the iPad to sync and then go back and make these changes.
    Launch iTunes and go to Edit>Preferences>Devices - check the box at the bottom.... Prevent iPods, iPhones ....
    Then set up your sync preferences like this using Apps as the example.
    Connect the iPad to the computer and launch iTunes.
    Click on the iPad name on the left side under devices.
    Click on the Apps Tab on the right.
    Click on all of the apps that you want to sync to that iPad
    Click on the Sync Apps Heading.
    Click on Apply in the lower right corner of iTunes
    You may want to uncheck Automatically Sync New Apps under the Sync Apps list

  • How to Test two UUT not at the same time??

    My test station need to test two UUT not at the same time ,Two UUT means two serial Number need to scan, and then test  each UUT after scan action . The two UUT are the same PCBA,all the test items are the same. So the sequence file is same. But how to realize it in TestStand ? Can you give me a simple example for that ? Thanks so much !

    Have a look at the process model options of TestStand. For your task I would  use the batch model. If I remember correctly there are also some examples delivered with Teststand. Search for MultiUUT and Processmodell in the examples directory of your Teststand installation.

  • How do you sync two iTunes accounts on the same MacBook Pro

    How do you sync two itunes accounts on the same Macbookpro?

    Not sure what you mean by "sync two itunes accounts".

  • How can I sync two separate iPhones on the same computer?

    How can I sync two separate iPhones on the same computer?

    How to use multiple iPods, iPads, or iPhones with one computer

Maybe you are looking for