Getting all of the NEW values from a trigger to store as XML CLOB

Our custom system has a number of tables which are given to us from a centralized reference data system. When data is incorrect or missing, the users have the ability to enter in a change request to the data.
We are looking at storing these changes as XML in CLOB colums to make the storage of the requests more generic. I was given this to work with:
SELECT value(em).getClobVal() AS "XMLTYPE"
FROM table(XMLSequence(Cursor(SELECT *
FROM TABLE_A
WHERE X=WHATEVER))) em;
Now that will give me an XML row for each return row. The problem is, I'm placing this in an AFTER INSERT TRIGGER so I cannot SELECT from the table, I can only use the values as passed in the REFERENCING section.
My problem is, I'd like to make this as generic as possible so I don't have to lay out the columns individually for each table we institute this on (there's about 70 of them).
I'm not sure if I'm explaining this well enough. This is on 10gR2. What I'm ultimately looking for is a generic way to take a row that was just inserted into a table, wrap it in XML tags corresponding to the column name and then insert that info into a CLOB in another table.

hi vittorio
i have a solution but im very sure it is not exact answer to your question . it will definitely help you .
create table temp_type as select * from emp where 1 = 2;
create or replace procedure emp_ins(emp_row emp%rowtype) as
pragma autonomous_transaction;
begin
insert into temp_type(empno,ename) values(emp_row.empno,emp_row.ename);
commit;
end;
create or replace trigger emp_ins_trig before insert on emp for each row
declare
/*  empr emp_types.emprowtype%type;*/
empr emp%rowtype;
begin
  empr.empno := :new.empno;
  empr.ename := :new.ename;
emp_ins(empr);
end;
/unfortunately , in oracle we dont have a facility to access the members of a record or recordset by their position
Such facility is very much there in Visual Basic , similar programming tools.
we can access the members of a recordset by the index position ( here index means the position of the field)

Similar Messages

  • Get the new value from an event structure block

    Hello!
    I'm using an event structure block. I've edited an event wich its event sources are an indicator an a variable (a real matrix). I want to get (to catch) the new value of the indicator and the variable from the frame placed at the left top, but the new value attribute is not a real not an integer.....is variant type. I have no idea what i have to do to catch this two values from here. Someone can post a simple example about it?
    Thanks in advance!
    Regards
    Larson 

    If the terminal is INSIDE the event structure, you'll always get the new value. It will NOT be read until the event case executes, at which point the terminal contains the new value. (If the terminal is outside the event structure, and the wire goes inside the event structure, you'll get a stale value when the event for that terminal triggers. This is expected from the dataflow.)
    Put the terminals inside the proper event case, you'll be fine!
    LabVIEW Champion . Do more with less code and in less time .

  • How to pass the NEW row from a trigger to a procedure

    I want to pass all NEW values from a trigger to a procedure.
    I wish to use a %ROWTYPE or similar,
    and I want neither to assigne them nor pass them one by one.
    Any suggestion?
    Thanks in advance

    hi vittorio
    i have a solution but im very sure it is not exact answer to your question . it will definitely help you .
    create table temp_type as select * from emp where 1 = 2;
    create or replace procedure emp_ins(emp_row emp%rowtype) as
    pragma autonomous_transaction;
    begin
    insert into temp_type(empno,ename) values(emp_row.empno,emp_row.ename);
    commit;
    end;
    create or replace trigger emp_ins_trig before insert on emp for each row
    declare
    /*  empr emp_types.emprowtype%type;*/
    empr emp%rowtype;
    begin
      empr.empno := :new.empno;
      empr.ename := :new.ename;
    emp_ins(empr);
    end;
    /unfortunately , in oracle we dont have a facility to access the members of a record or recordset by their position
    Such facility is very much there in Visual Basic , similar programming tools.
    we can access the members of a recordset by the index position ( here index means the position of the field)

  • I just upgraded to the new 4, but not sure how to make sure all my apps (purchases) get over to the new phone from iphone 3.  can't seem to find instructions. thanks.

    I just upgraded to the new iphone 4, but am hesitant to get it plugged in b/c I don't know how to make sure all the apps purchased on my iphone 3 get to the new phone.  can't seem to find instructions so I'm sure it just "does it", but hesitant to literally pull the plug.  thanks.

    Follow these instructions:  iPhone: Transferring information from your current iPhone to a new iPhone, http://support.apple.com/kb/ht2109

  • How can i get all of the new music I loaded into iTunes onto my iPod without deleting the content that is already on it?

    I just loaded a bunch of music from my CD library into iTunes in the hopes of loading it onto my iPod. The problem is now I can't figure out how to do it. Two issues... First it says that if I synch it will delete what is already on my iPod which I absolutely do not want. Second, is there a way to load each of the albums without having to create a play list?
    Ugh... Always a frustrating experience trying to deal with iTunes.

    You can only sync your device to one iTunes library at a time. You can either copy the music from the library on your other computer to the one you have loaded the new CDs onto, or you can purchase an external CD Drive and load them to the iTunes library you are currently sync'd with:
    iTunes: How to move your music to a new computer
    http://store.apple.com/us/search/External-CD-DVD---SuperDrive
    For syncing, I am not familiar with the drag and drop method. I have always used the normal sync process:
    iTunes 12 for Mac: Sync iPod, iPhone, or iPad
    iTunes 12 for Windows: Sync iPod, iPhone, or iPad
    Cheers,
    GB

  • Parsing the return value from a http request into a xml document?

    suppose a url "http;//abc.com/index.asp" that return a string like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <bbsend>
    <title>xml testing</title>
    - <record>
    <sender>111111</sender>
    <date>2004-01-05 04:11:44</date>
    <message>yes!</message>
    </record>
    - <record>
    <sender>22222222</sender>
    <date>2004-01-14 01:06:31</date>
    <message>A</message>
    </record>
    </bbsend>
    how can i parsing this return value into a xml document???
    i try something like this:
    URL url = new URL("http://abc.com/index.asp");
    HttpURLConnection http = (HttpURLConnection)url.openConnection();
    DataInputStream in = new DataInputStream(http.getInputStream());               
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(in);
    System.out.println(document.getNodeValue());
    But fail , can anyone help

    do u mean get the xml content??
    i am doing a project with BBSend
    [email protected]

  • Passing Values from a Trigger to a procedure

    Hi,
    How do i pass my OLD and NEW values from a Trigger to a Procedure. THe procedure will contain statements which will insert one record for each column with the OLD and NEW value.( I may have 31 inserts in the LOG table)
    Basically we have a table with 31 fields, i am tracking the changes done on that table, in my trigger i compare IF :OLD.COL1 <> :NEW.COL1 then i am inserting in a LOG Table if the values have changed.
    I am also tracking ie inserting in the LOG table if i am ADDING OR DELETING any row from the tabble.
    Thank yu

    It worked i created a RECORD type variable and passed OLD Value to one variable and NEW value to another variable.
    thanks

  • Just updated the latest Epson software printer update from Apple. Now all my prints look solarized. How do I get rid of the new update and go back to the perfect prints I had before? Help please.

    Just updated the latest Epson software printer update from Apple. Now all my prints look solarized. How do I get rid of the new update and go back to the perfect prints I had before? Help please. Wasting ink and paper at the moment!!!!!!
    I have tried the printer with my laptop (not updated) and everything is fine. It's just the beautiful 27" Imac that can no longer print.

    Might be a corrupted printer preference file ...
    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type this exactly as you see it here:
    ~/Library/Preferences
    Click Go
    Move the com.apple.PrinterPrefs.plist file from the Preferences folder to the Trash.
    Restart your Mac, restart the printer...

  • How do i get all my data and info from my old iphone onto my new one without access to the original itunes that i set my first iphone up on? my partners itunes keeps telling me that its going to replace all my apps and data with his stuff

    how do i get all my data and info from my old iphone onto my new one without access to the original itunes that i set my first iphone up on? my partners itunes keeps telling me that its going to replace all my apps and data with his stuff

    ok so i have my own i tunes library - how do i get all my old apps onto my new library?

  • Retirval problem for the old-new values from cdhdr,cdpos

    hi all.
    i want to get the old and new values from cdhdr and cdpos table but not getting the output as the if condition of read statement" if i_cdhdr-objectid = itemp-kunnr." is not getting executed.what could be the mistake and how can i resolve.plz suggest
    loop at it_knb1.
    itemp-kunnr = it_knb1-kunnr.
    itemp-kunnr1 = it_knb1-kunnr.
    append itemp.
    endloop.
    if not itemp[] is initial.
    select * from cdhdr
    into table i_cdhdr
    for all entries in itemp
    where OBJECTCLAS = 'DEBI'
    and   OBJECTID   = itemp-kunnr
    and  tcode      = 'VD02'.
    select * from cdhdr
    appending table i_cdhdr
    for all entries in itemp
    where OBJECTCLAS = 'DEBI'
    and   OBJECTID   = itemp-kunnr
    and   tcode      = 'XD02'.
    endif.
    if not i_cdhdr[]  is initial.
    select * from cdpos into table i_cdpos
    for all entries in i_cdhdr
    where OBJECTCLAS = i_cdhdr-OBJECTCLAS
    and   OBJECTID   = i_cdhdr-OBJECTID
    and   TABNAME    = 'KNVV'
    and   (  FNAME = 'ZTERM' ).
    endif.
    loop at it_knb1 where kunnr = it_kna1-kunnr.
    read table itemp with key kunnr1  = it_knb1-kunnr.
    if sy-subrc = 0.
    loop at i_cdhdr.
    if i_cdhdr-objectid = itemp-kunnr.
    it_final-username = i_cdhdr-username.
    clear i_cdpos.
    read table i_cdpos with key OBJECTCLAS = i_cdhdr-OBJECTCLAS
                                 OBJECTID   = i_cdhdr-OBJECTID
                                 FNAME = 'ZTERM'.
    if sy-subrc = 0.
        it_final-zterm_old  = i_cdpos-value_old.
        it_final-zterm_new  = i_cdpos-value_new.
      endif.
    endif.
    endloop.
    endif.
    endloop.

    Hi Tanisha,
    BEtter to loop everything cdhdr and CDPOS
    U can do one thing.
    Use CHANGEDOCUMENT_READ_HEDAER to get the data from CDHDR.
    SUE FM CHANGEDOCUMENT_READ_POSTIONS.
    to get the data from the each change number.
    then u can retrieve the data as u want.
    This will avoid confusion.
    U can get the correct data.
    Thanks

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • Remote Object - not able to get the returned value from java method

         Hi ,
    I am developing one sample flex aplication that connects to the java code and displays the returned value from the
    java method in flex client. Here I am able to invoke the java method but not able to collect the returned value.
    lastResult is giving null .  I am able to see the sysout messages in server console.
    I am using flex 3.2 and blazeds server  and java 1.5
    Here is the code what I have written.
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" initialize="initApp()">
     <mx:Script><![CDATA[
    import mx.controls.Alert; 
    import mx.binding.utils.ChangeWatcher; 
    import mx.rpc.events.ResultEvent; 
    import mx.messaging.*; 
    import mx.messaging.channels.* 
    public function initApp():void { 
         var cs:ChannelSet = new ChannelSet(); 
         var customChannel:Channel = new AMFChannel("my-amf", "http://localhost:8400/blazeds/messagebroker/amf");     cs.addChannel(customChannel);
         remoteObj.channelSet = cs;
    public function writeToConsole():void {      remoteObj.writeToConsole(
    "hello from Flash client");
          var returnedVal:String = remoteObj.setName().lastResult;     Alert.show(returnedVal);
    //[Bindable] 
    // private var returnedVal:String; 
    ]]>
    </mx:Script>
    <mx:RemoteObject id="remoteObj" destination="sro" /> 
    <mx:Form width="437" height="281">
     <mx:FormItem>  
    </mx:FormItem>  
    <mx:Button label="Write To Server Console" click="writeToConsole()"/>
     </mx:Form>
     </mx:WindowedApplication>
    Java code
    public  
         public SimpleRemoteObject(){  
              super();     }
      class SimpleRemoteObject { 
         public void writeToConsole(String msg) {          System.out.println("SimpleRemoteObject.write: " + msg);     }
         public String setName(){          System.
    out.println("Name changed in Java"); 
              return "Name changed in Java";
    And I have configured destination in  remote-config.xml
    <destination id="sro">
       <properties>    
        <source>SimpleRemoteObject</source>
        <scope>application</scope>
       </properties>
      </destination>
    Please help me .

    You are not able to get the returned value because if you see the Remote object help you will realise you have to use result="resultfn()" and fault = "faultfn()"
    In this you define what you wish to do.
    More importantly in the remote object you need to define which method you wish to call using the method class like this
    <mx:RemoteObject id="remoteObj" destination="sro" result="r1" fault="f1"  >
         <Method name="javaMethodName" result="r2" fault="f2"/>
    <mx:RemoteObject>
    r2 is the function where you get the result back from java and can use it to send the alert.

  • I got a new Macbook pro in March and transferred all of my old files into the new macbook from my old one. But ever since then, my iPhoto just does not open up. It says 'error' every time I try to open it, but I am still able to attach the iPhotos saved

    I got a new Macbook pro in March and transferred all of my old files into the new macbook from my old one. But ever since then, my iPhoto just does not open up. It says 'error' every time I try to open it, but I am still able to attach the iPhotos saved to emails. Help! How do I get my iPhoto back?

    Thanks, Sig.
    The old computer is a 2.6 Ghz Intel Core 2 Duo
    The new one is a 2.3 GHz intel core i7
    In going over this, thanks to "tallking it out" with you, I did discover the Text Edit problem.  Because I've still been unable to get the new computer text size (fonts or whatever) to match the old computer, I did not notice that the curser is now different--the line midway down the curser has to be placed on the line I am working upon, otherwise the edits go elsewhere on the page.  Now, with a bit of difficulty, I am able to get Text Edit to work correctly.
    If you have any ideas as to why my menu bar and Text Edit type are still so slow, I'd love to have them. 
    (I went through the process you suggested earlier, re my Trackpad preferences, and found no improvement.)

  • I had iTunes on my old computer and I am trying to get all of the same music on my new computer. I have download iTunes and signed in, but it is not showing up in my library. How do I get all of my old music back?

    I had iTunes on my old computer and I am trying to get all of the same music on my new computer. I have download iTunes and signed in, but it is not showing up in my library. How do I get all of my old music back?

    It does not magically appear in a new place.  It will only be where you put it.
    Copy everything from your old computer, or your backup copy of your old computer, to your new one.

  • How to get the Node Value from XmlValue result?

    Hi ,
    I am not able to get the Node Value from the result. In my XQuery im selecting till a Node, if i change my query as
    collection('PhoneBook')/phone_book/contact_person/address/string()", qc);
    im getting the node value, but here the problem is its not a Node so i cannot get the Node name.
    So how can i get the Node Name and Node value together?
    any help please ????
    XML :
    <?xml version="1.0" encoding="UTF-8"?>
    <phone_book>
    <contact_person>
    <name>
    <first_name>Michael</first_name>
    <second_name>Harrison</second_name>
    </name>
    <address city="yyyyy" pincode="600017" state="xxxxx">
    176 Ganesan street, Janakinagar, alwarthirunagar
    </address>
    </contact_person>
    <phone_number type="mobile">9881952233</phone_number>
    <phone_number type="home">044-24861311</phone_number>
    <phone_number type="office">080-12651174</phone_number>
    </phone_book>
    Code:
    XmlQueryContext qc = manager.createQueryContext();
    XmlResults rs = manager.query
    ("collection('PhoneBook')/phone_book/contact_person/address", qc);
    while(rs.hasNext()){
    XmlValue val = rs.next();
    System.out.println(val.getNodeName() + " = [ " + val.getNodeValue() + " ] ");
    Output
    address = [  ]

    You are right, this seemed un-intuitive to me too, but I finally understood how it's done.
    The "value" of a node is actually the total amount of text that is not contained in any of the node's child nodes (if any). So a node with child nodes can still have text value.
    To get the 'value' of an element node, you must therefore concatenate the values of all children of type "XmlValue::TEXT_NODE", of that node. Try it.
    In your example, the <address> node has no child elements, my guess is that BDB XML stores the address string "176 Ganesan street, Janakinagar, alwarthirunagar" inside a child node of <address> node (of type XmlValue::TEXT_NODE) because you wrote the string on a separate line.

Maybe you are looking for