XML updating --Urgent!

Hi,
I'm able to extract the Document out of the XML stored in the DB. I'm doing some changes like inserting new elements and removing some elements from the Document. How do I save the new Document back to the database?
The following is the code fragment:
String queryStr = "select e.xmlcol from TEMP_XML_AP e where e.fname='pid_cn_cn_ap_all_big.series_u_1115.xml'";
OraclePreparedStatement ostmt = (OraclePreparedStatement)con.prepareStatement(queryStr);
ResultSet rs = ostmt.executeQuery();
OracleResultSet orset = (OracleResultSet)rs;
while(orset.next())
{  OPAQUE op = orset.getOPAQUE(1);
XMLType theXML = XMLType.createXML(op);//;
Document doc = (Document)theXML.getDOM();
//add new element
doc.createTextNode("TEST");
//remove child
doc.removeChild("xyz");
Please tell me how to store back the updated document.
Thanks

You'll have a lot more luck with this question on dot.net
forum than here.
I use dot.net to return xml, but I have never used
XMLSerializer.
Tracy

Similar Messages

  • Re:XML update

    Hello Gurus ,
    i want to write a procedure for xml update ,
    consider,
    a table department consisting depart_no,depart_name,emp_Personal_info here emp_personal_info is a column of xmltype
    having data like (for a single department)(FOR DEPTNO 5801)
    <EMP>
      <EMPPERSONALINFO>
        <id>1</id>
        <name>x1</name>
        <join_date>12/2/2013</join_date>
        <work_station_no>LYH043897</work_station_no>
        <date_of_birth>2/2/1982</date_of_birth>
      </EMPPERSONALINFO>
      <EMPPERSONALINFO>
        <id>2</id>
        <name>x2</name>
        <join_date>2/5/2013</join_date>
        <work_station_no>LYH043898</work_station_no>
        <date_of_birth>30/5/1982</date_of_birth>
      </EMPPERSONALINFO>
    </EMP>a each department is holding information of over 100 employees(up to <id>100</id>)
    now i want to update emppersonal info with a new attribute <mainbranch>with a default data based on department number
    required output:
    <EMP>
      <EMPPERSONALINFO>
        <id>1</id>
        <name>x1</name>
        <join_date>12/2/2013</join_date>
        <work_station_no>LYH043897</work_station_no>
        <date_of_birth>2/2/1982'</date_of_birth>
        <mainbranch>CZDS</MAINBRANCH>
      </EMPPERSONALINFO>
      <EMPPERSONALINFO>
        <id>2</id>
        <name>x2</name>
        <join_date>2/5/2013</join_date>
        <work_station_no>LYH043898</work_station_no>
        <date_of_birth>30/5/1982</date_of_birth>
      <mainbranch>CZDS</MAINBRANCH>
      </EMPPERSONALINFO>
    </EMP>kindly guide me,
    regards,
    friend

    Hi,
    What's the database version?
    You've posted enough here to know how to properly ask a question.
    now i want to update emppersonal info with a new attribute <mainbranch>with a default data based on department numberYou wouldn't have such issue if the data model was correctly designed in the first place, using 3rd NF, i.e. with a separate child table to hold employee information.
    You can use insertchildXML or appendChildXML functions :
    SQL> update department t
      2  set t.emp_personal_info =
      3      insertchildxml(
      4        t.emp_personal_info
      5      , '/EMP/EMPPERSONALINFO'
      6      , 'mainbranch'
      7      , xmlelement("mainbranch", 'D' || t.dept_no)
      8      )
      9  where t.dept_no = 5801 ;
    1 row updated
    SQL> set long 5000
    SQL> select xmlserialize(document emp_personal_info indent) from department;
    XMLSERIALIZE(DOCUMENTEMP_PERSO
    <EMP>
      <EMPPERSONALINFO>
        <id>1</id>
        <name>x1</name>
        <join_date>12/2/2013</join_date>
        <work_station_no>LYH043897</work_station_no>
        <date_of_birth>2/2/1982</date_of_birth>
        <mainbranch>D5801</mainbranch>
      </EMPPERSONALINFO>
      <EMPPERSONALINFO>
        <id>2</id>
        <name>x2</name>
        <join_date>2/5/2013</join_date>
        <work_station_no>LYH043898</work_station_no>
        <date_of_birth>30/5/1982</date_of_birth>
        <mainbranch>D5801</mainbranch>
      </EMPPERSONALINFO>
    </EMP>
    These XML DML functions are deprecated as of 11.2.0.3 in favor of XQuery Update.

  • ITunes tantrum - xml update, lost songs, data1.cab errors

    Hi All,
    In the last couple of days my iTunes has thrown a real tantrum.
    When I switched on iTunes on the PC two days ago, it didn't come up straight away, instead it said it was updating the XML. This went on for ages, so thinking it was just one of those wonky start-ups, I hit cancel and loaded it again - the result half my songs were missing - about 3500 gone.
    I had a back-up of the xml & library so I brought those in and ran iTunes again - this time when it did its xml update I let it finish.
    The result was that all the songs added in the last month were gone - so I re-added them.
    The next day I opened it up and the new songs were gone. (It's a 40gb iPod photo, with about 30gb used).
    I decided to update iTunes from v6 to v7 to see if that helped.
    The upload kept failing (sulking about the iTunes & Quicktime .cab files), but after repeated tries it eventually went through.
    I was able to use it that night and re-loaded most of the songs.
    I tried to open iTunes this morning and it tells me that I haven't got Quicktime v7.1.3 installed only v7.1 - however I have checked and I do have v7.1.3 installed.
    I've tried to re-download the 34mb iTunes 7 setup exe from the Apple site and all it sends is an uncertified file of varying size between 70 & 700mb, which can't run anyway.
    I tried loading the original iTunes software from the disk, but it's kicked out straight away due to a later version being in place.
    Please help, I've tried all the options my tiny brain can offer.
    Thanks,
    Paul

    Paul,
    Whilst it's possible you may get help in this Forum, you have a much better chance if you re post in the iTunes/Windows forum which is here.
    http://discussions.apple.com/forum.jspa?forumID=792
    There are experts there who rarely visit the iPod forums.

  • ITunes tantrum - xml update, lost songs, not recognising new Quicktime

    Hi All,
    In the last couple of days my iTunes has thrown a real tantrum.
    When I switched on iTunes on the PC two days ago, it didn't come up straight away, instead it said it was updating the XML. This went on for ages, so thinking it was just one of those wonky start-ups, I hit cancel and loaded it again - the result half my songs were missing - about 3500 gone.
    I had a back-up of the xml & library so I brought those in and ran iTunes again - this time when it did its xml update I let it finish.
    The result was that all the songs added in the last month were gone - so I re-added them.
    The next day I opened it up and the new songs were gone. (It's a 40gb iPod photo, with about 30gb used).
    I decided to update iTunes from v6 to v7 to see if that helped.
    The upload kept failing (sulking about the iTunes & Quicktime .cab files), but after repeated tries it eventually went through.
    I was able to use it that night and re-loaded most of the songs.
    I tried to open iTunes this morning and it tells me that I haven't got Quicktime v7.1.3 installed only v7.1 - however I have checked and I do have v7.1.3 installed.
    I've tried to re-download the 34mb iTunes 7 setup exe from the Apple site and all it sends is an uncertified file of varying size between 70 & 700mb, which can't run anyway.
    I tried loading the original iTunes software from the disk, but it's kicked out straight away due to a later version being in place.
    Please help, I've tried all the options my tiny brain can offer.
    Thanks,
    Paul

    Paul,
    Whilst it's possible you may get help in this Forum, you have a much better chance if you re post in the iTunes/Windows forum which is here.
    http://discussions.apple.com/forum.jspa?forumID=792
    There are experts there who rarely visit the iPod forums.

  • How to update combobox that with xml source binding when xml updated in Powershell

    I'm just newbie to WPF & Powershell. Currently have a Powershell program with XAML UI. Herein a combobox control binding a xml file. The problem lays in how can I update the combobox once xml updated? Thanks in advance!

    Hello sihat,
    I've read some articles about using PowerShell and WPF:
    https://msdn.microsoft.com/en-us/magazine/hh288074.aspx
    http://blogs.technet.com/b/heyscriptingguy/archive/2014/04/06/weekend-scripter-build-a-clock-widget-by-using-powershell-and-wpf.aspx
    It seems the steps are all related to using PowerShell to create WPF UI. As the script comes from PowerShell I would think that PowerShell related forum may much better.
    I will introduce things in WPF, if you want to make UI update based on your source,  the source must implement a suitable property change notification mechanism such as
    INotifyPropertyChanged. See
    How to: Implement Property Change Notification for an example of an
    INotifyPropertyChanged implementation.
    For more details about this WPF scenario, please see WPF databinding:
    https://msdn.microsoft.com/en-us/library/ms752347(v=vs.110).aspx
    If you want to do the same in PowerShell, please consider to post on PowerShell related forum to ask how you can write the same script.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • XML Output(Urgent)

    Hi,
    I want to build XML file like this(below one) in .NET.I am
    getting one sub element i.e Year .But I am not getting Item and its
    attributes within the Year element.Its very Urgent.I am using XML
    serializer for this.
    <energyrecap>
    <year id="2006">
    <item type="usage" value="4.666" month="Jan" />
    <item type="usage" value="4.666" month="Feb" />
    <item type="usage" value="4.666" month="Mar" />
    <item type="usage" value="4.666" month="Apr" />
    </year>
    <year id="2007">
    <item type="usage" value="5.666" month="Sep" />
    <item type="usage" value="4.666" month="Oct" />
    <item type="usage" value="3.666" month="Nov" />
    <item type="usage" value="5.666" month="Dec" />
    </year>
    </energyrecap>

    You'll have a lot more luck with this question on dot.net
    forum than here.
    I use dot.net to return xml, but I have never used
    XMLSerializer.
    Tracy

  • HTML Tags in XML Update

    I have a unique situation (may be not that unique). I want to update or add HTML tags in an XML element I am writing a PL/SQL Stored Procedure to insert, update or delete elements/attributes from an XML Type column based on the input XML (coming from Java application). SP is called from Java app. For example my XML may loook like
    <Description Name="Sales Message">
    <Text>This is a test</Text>
    </Description>
    I can update this in XML by creatinga SP which accepts a value (clob or text) and make a simple update call like
    UPDATE table_name
    SET hotel_xml = UPDATEXML (hotel_xml, Description[@Name=''Sales Message'']/Text/text()', 'This is a Test')
    WHERE id = 123;
    Hopwever when I have HTML tags in my parameter value, my update fails. For example java pp passes me a string
    This is a bold &lt;B&gt;Test&lt;/B&gt;
    (without encoding it is "This is a Bold <B>Test</B>"
    When I run this
    UPDATE table_name
    SET hotel_xml = UPDATEXML (hotel_xml, Description[@Name=''Sales Message'']/Text/text()', 'This is a bold &lt;B&gt;Test&lt;/B&gt;')
    WHERE id = 123;
    It thinks, I am passing a substitution variable (think &lt and &gt as sub variables) and the procedure fails.
    How do I handle HTML encoded charcters in Oarcle Pl/SQL? Many of my SPs has to accept XML as clob that may contain HTML encoding. Java always encodes HTML tags in an XML so I have to pass the CLOB(xml) to a SP as it is

    When this type of encoding is there in my XML or input variable, PL/SQL thinks
    its a substitution variable and tries to replace it by prompting replacement. I think »substitution variables« is the wrong phrase for this. Probably you mean »entity names«, and all that happens is that special characters are converted to »entity names« to ensure valid xml after the update:
    SQL> with table_name as (
    select xmltype('<Description Name="Sales Message">
                       <Text>This is a test</Text>
                     </Description>') hotel_xml from dual)
    select updatexml (hotel_xml,
                      'Description[@Name="Sales Message"]/Text/text()',
                      'This is a bold <B>Test</B>'
                     ) hotel_xml
      from table_name
    HOTEL_XML                                                                                             
    <Description Name="Sales Message"><Text>This is a bold &amp;lt;B&amp;gt;Test&amp;lt;/B&amp;gt;</Text></Description> Do you expect your result to look like
    <Description Name="Sales Message">
      <Text>This is a bold <B>Test</B></Text>
    </Description>??

  • Oracle 8i XML Support (Urgent !)

    Hi
    I would like to know the support offered by Oracle 8i for
    storing XML documents in database and querying on them.
    What component of 8i offers this support and in what way is it
    different from support offered by PLSXML ?
    I am looking to store XML documents in Oracle 8i database and
    querying on them. Also I want to extract data from database and
    dynamically generate HTML paged for on-line viewing.
    This information is very crucial to me. Help of any kind is
    welcome on the same.
    Hoping for some quick replies,
    Premal Mehta.
    null

    I am not sure to which features you refer? If you are asking
    about the CONTAINS operator that works in 8i now. The document
    registration to a schema will be delivered in the iFS beta.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Samuil Angelov (guest) wrote:
    : As I have the same kind of a problem and need an urgent
    solution
    : of it I need information whether these features will be
    : implemented in the beta version of iFS that is to be released.
    : Regards
    : Samuil
    : Oracle XML Team wrote:
    : : Currently you can store your documents in CLOBs and use
    : : intermedia Text to search for data between tags with its
    : CONTAINS
    : : operator. When we release iFS you will be able to break
    apart
    : : that document and insert its data into tables based upon a
    DTD
    : to
    : : Schema registration file and do additional SQL queries as
    well.
    : : Check out
    : http://www.oracle.com/database/options/intermedia.html
    : : and http://www.oracle.com/database/options/ifs.html for more
    : : details.
    : : Oracle XML Team
    : : Oracle Technology Network
    : : Premal Mehta (guest) wrote:
    : : : Hi
    : : : I would like to know the support offered by Oracle 8i
    for
    : : : storing XML documents in database and querying on them.
    : : : What component of 8i offers this support and in what way
    is
    : : it
    : : : different from support offered by PLSXML ?
    : : : I am looking to store XML documents in Oracle 8i database
    : and
    : : : querying on them. Also I want to extract data from database
    : and
    : : : dynamically generate HTML paged for on-line viewing.
    : : : This information is very crucial to me. Help of any kind
    is
    : : : welcome on the same.
    : : : Hoping for some quick replies,
    : : : Premal Mehta.
    : : http://technet.oracle.com
    null

  • Production order Qty update-urgent.

    Hi all,
    I want a query that must not allow me to  update the Qty in the Production order.Once production order created from the MRP,it should not allow me to update any Qty at the production orer level what should be query its urgent.
    mona.
    thanx in advance.

    Hi Mona,
    Query is only for report.  It will not be the tool you are looking for this task.
    The SBO_Transaction_Notification SP can be used instead. There are quite a few threads discuss this topic.  Try search in the forum to find what you need.
    Thanks,
    Gordon

  • XML update a query?

    Hey, I'm trying to get an xml query to work which when you click a button will load the next items on the xml structure.
    so like
    private var currentQueryNumber : uint = 0;
    private function updateQuery(no:uint){
         {currentQueryNumber + 1};}
    isn't right...
    Anyone able to help me in what I should be putting.

    I think we need more details, and simplified yet "complete" code.
    How is currentQueryNumber used to update the query?
    Need more details.

  • XML ContentHandler (URGENT)

    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import javax.xml.parsers.*;
    public class BandRead {
         public void read() throws Exception {
              SAXParserFactory spf = SAXParserFactory.newInstance();
              XMLReader parser = null;
              SAXParser saxParser = spf.newSAXParser();
              parser = saxParser.getXMLReader();
              parser.setContentHandler(this);
              parser.parse("file:///c:/Program files/Jcreator le/myprojects/band.xml");
         public void startDocument() throws SAXException {
              System.out.println("Starting ...");
         public void endDocument() throws SAXException {
              System.out.println("... Finished");
         public static void main(String[] args) throws Exception {
              System.out.println("Let's go parse!");
              BandRead x = new BandRead();
              x.read();
    I having problems with setting the ContentHandler... Since now SAX 2.0 is used, the DefaultHandler is deprecated. What do I do? Make my own ContentHandler? And If I do, what do I do with the methods? What do I put in when overridding? (URGENT)

    Er I found the answer already thanks.
    In case to those who found the same problem as me, (Due to using books in the library that are using the deprecated information without any information of where to go) you have to create an inner class that implements ContentHandler and you have to override all the methods. Basically you can leave the unknown methods alone. ex.
    public void startPrefixMapping(String prefix, String uri) {}

  • XML Update

    I have a question for updating an xml document.
    I will show it on an example. I have follow xml document as xml type in the db.
    <EMPLOYEES>
    <EMP>
    <EMPNO>112</EMPNO>
    <EMPNAME>Joe</EMPNAME>
    <SALARY>50000</SALARY>
    </EMP>
    <EMP>
    <EMPNO>217</EMPNO>
    <EMPNAME>Jane</EMPNAME>
    <SALARY>60000</SALARY>
    </EMP>
    <EMP>
    <EMPNO>412</EMPNO>
    <EMPNAME>Jack</EMPNAME>
    <SALARY>40000</SALARY>
    </EMP>
    </EMPLOYEES>
    I know how to update the existing elements(change the EMPNAME or SALSRY) but how can i add a new EMP. The result should like this:
    <EMP>
    <EMPNO>112</EMPNO>
    <EMPNAME>Joe</EMPNAME>
    <SALARY>50000</SALARY>
    </EMP>
    <EMP>
    <EMPNO>217</EMPNO>
    <EMPNAME>Jane</EMPNAME>
    <SALARY>60000</SALARY>
    </EMP>
    <EMP>
    <EMPNO>412</EMPNO>
    <EMPNAME>Jack</EMPNAME>
    <SALARY>40000</SALARY>
    </EMP>
    <--begin new element -->
    <EMP>
    <EMPNO>111</EMPNO>
    <EMPNAME>NEW</EMPNAME>
    <SALARY>1111</SALARY>
    </EMP>
    <-- end new element -->
    </EMPLOYEES>
    Is this possible with XMLupdate???

    Today in 9.2 and 10.1 you have to the DBMS_XMLDOM package. In 10.2 there will be new SQL functions insertChildXML(), appendChildXML() deleteXML() to do this

  • *** XML MESSAGES (URGENT PLEASE) ***

    Hi,
    we are using XI 3.0 support pack 20, having some problem to XML messages to emil
    tr: SXMB_MONI  shows all alerts from different servers, and eamil only my user with Subject: Alert and attachment file...
    I didn't define any attachment file, or when I change continer variables nothing changed anyting...
    I am sending some screen shot please figure it out where i am getting mistake....
    http://www.flickr.com/photos/25222280@N03/
    and I am following this doc.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0b4580be-0601-0010-d3ad-bd6ce51ae916
    Note: This is very urgent please
    Thanks in advanced

    I would start with fixing the "unable to convert sender system" error..
    Michals  blog for solution...
    /people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
    Regards
    Ravi Raman

  • How to automate managed beans.xml update

    I am using JSC 2.0 ea and am trying to add a "loginBean" based on the example in java studio creator field guide. The process explained in the book, ie right-click "source package" add java package, right-click newly created package and add "managed bean" - this does not exist in jsc 2.0, so when you add a class file the managed-beans.xml file is not updated - is their an automated process to add a managed bean in jsc 2.0?

    Hi,
    Please post messages related to Creator 2 EA at the feedbacks programs portal. The URL is:
    https://feedbackprograms.sun.com/login.html
    Thanks,
    Creator Team

  • (MIGO) Inconsistent  table updation  ------URGENT

    hi experts,
    I am struck up with seious problem.
    I am updating the material document created during MIGO into my Ztable through MB_MIGO_BADI ( method: POST_DOCUMENT).
    the issue here is , some documents are not get updated into Ztable while some gets updated. When i check in DEV & quality it goes fine.
    The scenario here is some 10 plants with 3 machines each use MIGO at the same time. Is the problem due to concurrent access.........?
    Pls guide me....URGENT
    thank u
    sarav

    Hi Sarav,
    Are you using the COMMIT after the updation. If you are using the same then add
    COMMIT AND WAIT FOR 2 SECONDS.
    This should resolve your issue.
    Regards,
    Atish

Maybe you are looking for

  • A big problem: camera roll doesn't work

    I cannot use the default "camera" to take photo. When I press the "taking photo" button or "volume + " button, the "camera" app would turn off and as a result return to the background. I cannot really delete the photos in the camera roll as well. Whe

  • Converting excel 2013 to pdf with adobe acrobat 9

    I have tried and failed many times to convert an excel 2013 spreadsheet into  a pdf with adobe acrobat 9. Is this a compatibility issue, Acrobat 9 needs upgrade?

  • How do I superscript text in Ver 3.6?

    The font dialog box has changed in Ver 3.6 and I can't find a way to superscript text when making a book.

  • Can I turn iTunes Match Upload OFF?

    All of my unpurchased music is ripped ALAC, so if iTunes can't find it in MATCH, it uploads all of these HUGE files.  I've got over 9000 tunes that it's doing this to.  I really DON'T want to stream ALAC files to my phone or anything else.  Is there

  • Reg- How to Check pending dispatch quantity for an order?

    HI,    Pls guide me how to check the pending quantity to be dispatched for an order. I Have explained herewith my requirement. A sales order is created for 10 quantities, out of which 6 are delivered. What is the path to check the balance 4 quantitie