Trigger that makes concatenation rows into cols and inserts to another tab.

Hi,
I have a trigger to do. Let me explain you how everything looks like in my DB.
TABLE A
O_ID | NAME
1 | A_Name1
2 | A_Name2
3 | A_Name3
4 | A_Name4
TABLE B
O_ID | NAME | DATE
1 | ATT_15 |2011-01-01
1 | ATT_16 |2011-01-02
2 | ATT_15 |2011-03-03
4 | ATT_19 |2011-03-05
TABLE C (dictionary)
P_ID | P_NAMEATTRIBUTE
1 | P1
2 | P2
3 | P3
4 | P4
TABLE D
O_ID | P_ID
1 | 1
1 | 2
1 | 4
2 | 3
2 | 4
4 | 2
Basicly, all I'm trying to do is make a trigger based on:
When you update Table A do an insert into Table B. What should be inserted?
All ID’s from table C that matches trough TABLE D
A.O_ID = D.O_ID and C.P_ID = D.P_ID but concatenated.
I would like to have in this case inserted into table B records like that:
O_ID | P_ID | P_NAMEATTRIBUTE
1 | 1 2 | P1 P2 P4
2 | 3 4 | P3 P4
4 | 2 | P2
Let's hope it's comprehensive. :)
Regards!

nodex wrote:
I have tried to fire procedure from trigger. It works almost fine but there is always one row less than expected. I tried to reconfigure trigger in many ways but it didn't help.I meant show us an example your code with some data so we can see what you're doing.
It's not really hard to concatenate rows into columns (wm_concat e.g.). It's hard to store it in a trigger.I wouldn't use wm_concat as it is an unsupported function, which can render your whole system unsupported by Oracle if the issue is found to be due to you using that. Also, Oracle can choose to change the functionality of that function in later versions if they want which could effect your expected output.
In 10g or below, you should use sys_connect_by_path method to aggregate data. In 11gR2 there is the new LISTAGG analytical function.
Saying "It's hard to store it in a trigger" doesn't tell us anything. Why is it hard? What problem are you experiencing?

Similar Messages

  • Acrobat form field that allows Reader user to browse and insert a picture into a predefined area

    Is there a way to do insert a form field into an AcroForm that allow Reader users to browse and insert a picture into that form field?
    I know that LiveCycle can do this, but I need to do this using an AcroForm. Or maybe there's a third-party plug-in that can be used in an AcroForm to do this?

    Jay,
    The new version of Reader, which was announced today (see AcrobatUsers.com), will now allow you to use the field.buttonImportIcon method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.737.html
    For a bit more information, see: http://forums.adobe.com/thread/743823
    Here's the minimum code that can be used in the Mouse Up event of a button that's configured with a layout that's something other than "Label only":
    // Mouse Up script for a button
    event.target.buttonImportIcon();
    Since this isn't backwards compatible with Reader, you'll probably want to add additional code to test what version is being used and alert the user if it's pre-11. You should also check the return value to see if anything went wrong. The hard part is getting everyone to upgrade, but this and a number of other features should make it worth it.

  • I am having a problem where pdf files on the web (i.e., links in a Word doc) open after an extended time and only as gobbldygook ( a file containing a series of characters and letters that make no sense).  This also happens for another Mac user coworker

    Hi There:  I am having a problem where pdf files on the web (i.e., links in a Word doc) open after an extended time and only as gobbldygook ( a file containing a series of characters and letters that make no sense).  This also happens for another Mac user coworker in my office, while the PCs don't have this problem...  Any help/suggestions for a fix would be most appreciated! 

    Just adding more info - MacBookPro running 10.5.8 and using Safari as the browser.  The problem comes and goes - sometimes the linked Word files will open OK, n others its just a strring of crazy characters... 

  • My Illustrator is not recognizing that I am signed into Adobe and thus my Kuler panel is not enabled.

    My Illustrator is not recognizing that I am signed into Adobe and thus my Kuler panel is not enabled.

    DT,
    You may try to restart the Creative Cloud application by quitting and relaunching it.

  • XML document convert into String and Insert into Database

    Hello all,
         In the FIle to File Scenario  I want to send the data to the Reciever System in xml Document and convert into String and insert into Database.
      Please can you tell me exact way how to send it.
    Thanks & Regards,
    Raj

    HI,
    As per my understanding your scenario is File to file where you will get output fiel in XML format.
    Now that XMl payload need to be passed as single string in the database via XI.
    You cauld do this but you need to imply some manipulations such as
    With the help of standard API you need to concatenate the  XML tags and create the structre along with the data.
    For e.g. in your outpuf file the XML structre contain data as
    <field1>ABCD</field1>
    Then in mapping
    The source field will be mappeda s concat(<field1>) + value of  Source field "ABCD" + concat(</field1>) to the target field.
    This is the way that you could achive the requirments else there is no direct way avaialble for it.
    thanks
    Swarup

  • My centre button has stopped working and my top lock button has stopped working too. I've had this iPhone 2 years now, can I take it into apple and swap for another phone or am I not covered? Thanks

    My centre button has stopped working and my top lock button has stopped working too. I've had this iPhone 2 years now, can I take it into apple and swap for another phone or am I not covered? Thanks

    The standard Apple warranty is 1 year. I believe you can purchase AppleCare+, which extends the warranty to two years from the date of purchase. This extended warranty needs to be purchased within 30 days of the purchase date for the phone.
    If you have the extended warranty, you may be able to get a replacement phone at no cost. You will need to make an appointment at an Apple Store Genuis Bar and have them take a look at the phone.
    If you did not purchase the additional warranty coverage, you should be able to purchase an Out-of-Warranty replacement, which is $199 for the iPhone 4S.
    ~Lyssa

  • I have iphone 5 ,i cut down bsnl 64k sim into nano and inserted it. everything is working except cellular data or 3g data, please help me

    i have iphone 5 ,i cut down bsnl 64k sim into nano and inserted it. everything is working calling & messaging except cellular data or 3g data, please help me

    Everything you need to know about the solution is written into the question you posed. Get a proper SIM.

  • I lost my iPhone recently. It has since disappeared from support profile. Does this suggest that the phone has been restored and synced with another account?

    I lost my iPhone recently. It has since disappeared from support profile. Does this suggest that the phone has been restored and synced with another account?

    See:
    What to do if your Apple ID has been hacked
    (Fair disclosure: The Safe Mac is my site, and contains a Donate button, so I may receive compensation for providing links to The Safe Mac. Donations are not required.)

  • I have tried loading 3 different cds that I just bought into Itunes and I click the import cd button and it goes through the motions of importing the cds, but when I go to my library none of these cds is there.  Help, please!

    I have tried loading 3 different cds that I recently purchased into Itunes.  I click the import cd button and Itunes goes through the motion of copying and importing the cds, but the songs are not in my music library.  I have searched everywhere to find where these cds might be, but to no avail.  Could really use some help here.  Never used to have this problem.

    Are they in the relevant artist & album folders when you look via Windows Explorer. If so something may have gone wrong with the index of the Music playlist. Download the current iTunes Free Single of the Week. I know it sounds odd, but it should fix the problem.
    If that doesn't work close iTunes and delete the hidden file sentinel from inside the main iTunes folder, then start iTunes again. It should run a consistency check when it starts up.
    tt2

  • Will deleting my you tube app affect my youtube accounts becuase since uploading the latest Apple update, everytime I go to click on something on my youtube page, it switches to the app and then comes back and opens up another tab and never did that

    I am having a problem with my youtube account, as since updating to iOS 8.3, the other day, every time I go to my youtube account and click on anything there by opening up a tab, it always goes to the youtube app and then goes back and opens a new tab.  Everytime I have updated, it seems to get worse not better.  One other thing that happened that has not been fixed yet when I updated a while ago, was that when you have many tabs open and go back and forth between them, it aleays reloads and does not stay the way you left it.  Wish Apple would get it right and especially with youtube issues.  So my question regarding my youtube account would be if I can delete the youtube app, without affecting my account.

    If you delete the YouTube app you will not be affecting your YouTube account.  You can always reinstall it & see if that fixes the problem.
    As far as Safari pages reloading between tabs, I have also noticed the issue after iOS 8 on my iPad 2.  Updating to the latest iOS on older devices can see a degradation in performance within certain apps due to the limitations of those devices. 
    We made the choice to update & with the many benefits of the latest & greatest iOS there are bound to be some problems too, 

  • Everytime I open the window it keeps on reloading it self over and over again and when it's not doing that and I open another tab and try to go back to the previous tab it reloads itself....Please Help

    Every time I open a window in firefox it constantly reload itself and when I finally get it to stop and open another tab and try to go back to the previous tab it reload itself....Please Help
    == This happened ==
    Every time Firefox opened
    == About 4 months ago

    Do you have that problem when running in the Firefox SafeMode?
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Report on one table and insert to another?

    Ok, this is probably a stupid question, but it's boggling me.
    I have a "view" that I am searching to pull back results on. Then I need to take that ID_NUMBER and pass it to a form that will take those values and insert them into a regular "table" with two unique values [id] = autonumber, and [id_number] = unique id from the view.
    I can get the form to filter the correct results, but it won't allow me to do the DML to process the row (insert)
    any suggestions?

    DISSREGARD PLEASE ... I'VE FIGURED IT OUT.

  • Firefox gets Stuck while Playing Facebook Games and Working in Another Tab

    Firefox gets stuck while playing facebook games (restaurant city) and side by side working in another tab or window of firefox. Switching between tabs takes time and on facebook scrolling doesn't remain smooth it gets stuck again and again while scrolling the page.
    Also, in earlier versions it was a great feature that when once a game is loaded then when i open it second time it was loaded immediately without any complete loading but now every time you play the same game it will load completely which happens generally when we reinstall firefox so that our saved cookies gets destroyed.
    ON THE OTHER HAND OPERA 10.6 LOADS FACEBOOK GAMES SMOOTHLY NO HANGS NO STUCKS NO FREEZES EVEN DOING OTHER WORK AND THE GAME ALSO LOADS IMMEDIATELY THE NEXT TIME WHEN IT IS OPENED.
    == This happened ==
    Every time Firefox opened
    == The 3.6 versions came up

    same things happen to me also the cache system is so slow it even download the flash player game after 3 or 4 days completely and hang is always the error when ever i use the fire fox also there is one more thing some time computer is not opening any site what ever u type mozilla is disconnected from IP what ever he issue is but if u close the firefox and start again it is working for a while after some time it may happen again time is not counted over this matter so i m sure this is the trouble from fire fox coz other browsers are working in the same time while mozila sucks

  • Will running games that make the fan run loudly and the computer heat up damage my machine?

    On my Macbook Air running Yosemite 10.10.3, with 4 GB RAM, 251 GB storage (170 GB free), a 1.6 GHz Intel Core i5 processor, and Intel HD 6000 1536 MB graphics card, when I play games such as Batman Arkham City, I experience very smooth gameplay with high fps. The only thing that worries me is when I play, the laptop heats up very much and the fan runs pretty loudly. Even with old, less intensive games like GTA SA, the computer gets pretty hot and the fan runs loudly. Is this damaging the computer, or can I continue to play these games?
    Thanks.

    Yes you can continue to play games but heat is the bane of electronics and in time there will be a cost.  When is hard to say, but I can put it this way, a fan running constantly at high speed is more likely to fail sooner than one at a slower speed.
    Ciao.

  • Apple E-mailed me an alert saying that I had signed into icloud and Facebook. I have neither. Changed my pass word. Should I be any more worried? Any way to find how this happend?

    Same as new discussion.

    If you don't have an iCloud account and you are not a FaceBook user, you changed the password for your Apple ID?
    Did you look at the email address behind the name shown as the sender of this email?
    Are there any links included with this email and if so, for what?

Maybe you are looking for

  • Create Node (Mapping)

    Hi My Req is as below Source row (0..unbound) matnr movetype (101) weight Now target should be generated based on the move type 101 , for each move type 101 i should generate 101 as usual and 261 record as below item(0..unbound) matnr Movetype (101)

  • Problem with deploy .war (Jboss3.2.1-JBuilder8)

    Hi. I'm trying to deploy a web application with JBuilder8 into JBoss3.2.1 I use a plug-in (Voyager2.6) to integrate JBuilder with JBoss. The .war compiles OK. But when I try to run it, it take me a lot of errors: 11:17:45,715 ERROR [NamingService] Co

  • IPhoto book templates...

    Are there other book templates that can be used in iPhoto?  Looking for more variety than what is offered in iPhoto!  Thanks.

  • Why can't my email account be verified to set up iCloud backup?

    Why can't iCloud verify my email address?

  • Ways to upload via another computer?

    Hi, I have made a website in iweb but would prefer not to put my Mac on the net as otherwise it is literally only used for music and is running fairly smoothly. Is there any way that I can somehow transfer it as a file to my internet pc and upload it