Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: XML Update??

 
0
  #11
Jan 21st, 2008
How can I fix Out Of Memory error while executing XML updates stored procedure?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Update??

 
0
  #12
Jan 24th, 2008
This exception is typically found only on 32-bit JVMs. Native memory leak is the reason for java.lang.OutOfMemoryError exception while running XML update stored procedure. The java heap size should be updated to fix this problem.

The below command updates java heap size to 1024.

db2 update dbm cfg using JAVA_HEAP_SZ 1024
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 3
Reputation: wrestle23 is an unknown quantity at this point 
Solved Threads: 0
wrestle23's Avatar
wrestle23 wrestle23 is offline Offline
Newbie Poster

Re: XML Update??

 
0
  #13
Jan 26th, 2008
execute the source code mate
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: XML Update??

 
0
  #14
Feb 6th, 2008
I am not able to add a new element to XML document using XMLUPDATE stored procedure. I am not sure if I am missing something. Can someone give a working sample?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Update??

 
0
  #15
Feb 14th, 2008
Suppose that we have to add a new e-email address for clients. Below example shows how to add a new element in an XML document using the XMLUPDATE stored procedure.

CALL DB2XMLFUNCTIONS.XMLUPDATE(
'<updates>
<update action="append" col="1" path="/addr">
<Email>newEmail@yahoo.com</Email>
</update>
</updates>',
'select doc from CLIENTS where id=77',
'update CLIENTS set contactinfo=? where id=77', ?, ?);

i) action=”append” : we add new element
ii) col=”1” : we work with the first XML column returned by querySQL.
iii) path=”/addr” : the element we add will be a child to this element.
iv) <Email>newEmail@yahoo.com</Email> : the new element
v) ‘select doc from CLIENTS where id=77’ : Our querySQL
vi) ‘update CLIENTS ser cotactinfo=? Where id=77’ : Our updateSQL
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: XML Update??

 
0
  #16
Mar 10th, 2008
How can I validate xml document against an xml schema while updating an existing xml data in the database using update stored procedure?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Update??

 
0
  #17
Mar 17th, 2008
First you need to create and register xml schema. Here, consider test.schema xml schema has been registered.

In the below example we are trying to update xml document stored in info column and validate the updated document against the test.schema2 xml schema.


RSS, Web Services and SOAP Syntax (Toggle Plain Text)
  1. Call DB2XMLFUNCTIONS.XMLUPDATE (
  2. '<updates namespaces="x:http://posample.org">
  3. <update using="sql" action="replace" col="1"
  4. path="/x:customerinfo/x:addr/x:pcode-zip/text()">
  5. select cid from Customer where cid=1004
  6. </update>
  7. </updates>',
  8. 'Select info from Customer where cid=1004',
  9. 'update Customer set info=xmlvalidate(
  10. ? according to XMLSCHEMA ID test.schema) where cid=1004',?,?)
Last edited by peter_budo; Mar 17th, 2008 at 10:38 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the RSS, Web Services and SOAP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC