User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 374,167 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,334 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser:
Views: 3687 | Replies: 16
Reply
Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: XML Update??

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

Re: XML Update??

  #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  
Join Date: Oct 2007
Location: Sydney,Australia
Posts: 3
Reputation: wrestle23 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
wrestle23's Avatar
wrestle23 wrestle23 is offline Offline
Newbie Poster

Re: XML Update??

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

Re: XML Update??

  #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  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Update??

  #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  
Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: XML Update??

  #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  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Update??

  #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.


Call DB2XMLFUNCTIONS.XMLUPDATE (
'<updates namespaces="x:http://posample.org">
<update using="sql" action="replace" col="1"
path="/x:customerinfo/x:addr/x:pcode-zip/text()">
select cid from Customer where cid=1004
</update>
</updates>',
'Select info from Customer where cid=1004',
'update Customer set info=xmlvalidate(
? according to XMLSCHEMA ID test.schema) where cid=1004',?,?)
Last edited by peter_budo : Mar 17th, 2008 at 9:38 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb RSS, Web Services and SOAP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the RSS, Web Services and SOAP Forum

All times are GMT -4. The time now is 4:15 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC