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 403,510 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 4,090 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: Programming Forums
Views: 8732 | Replies: 79
Reply
Join Date: Sep 2007
Posts: 19
Reputation: s.piyush58 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
s.piyush58 s.piyush58 is offline Offline
Newbie Poster

Re: XML Management

  #31  
Oct 24th, 2007
How can I Query the XML data from the database?
Reply With Quote  
Join Date: Oct 2007
Posts: 36
Reputation: mallar6 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mallar6 mallar6 is offline Offline
Light Poster

Solution Re: XML Management

  #32  
Oct 24th, 2007
DB2 9 supports query languages familiar to both relational and XML programmers. The XML data can be obtained using SQL or XQuery.
Reply With Quote  
Join Date: Sep 2007
Posts: 19
Reputation: s.piyush58 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
s.piyush58 s.piyush58 is offline Offline
Newbie Poster

Question Re: XML Management

  #33  
Oct 24th, 2007
What is XQuery? Is this different from SQL?
Reply With Quote  
Join Date: Oct 2007
Posts: 36
Reputation: mallar6 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mallar6 mallar6 is offline Offline
Light Poster

Solution Re: XML Management

  #34  
Oct 24th, 2007
XQuery is a new query language that supports navigational (or path-based) expressions. In fact, your applications can employ freely statements from both query languages, and a single query statement can actually incorporate both SQL and XQuery. The results of queries can return data in relational and XML formats, or a combination of both.

XQuery differs from SQL in a number of key respects, largely because the languages were designed to work with different data models that have different characteristics. XQuery supports path expressions to enable programmers to navigate through XML's hierarchical structure, while plain SQL (without XML extensions) does not. XQuery supports both typed and untyped data, while SQL data is always defined with a specific type. XQuery lacks null values because XML documents omit missing or unknown data. SQL, of course, uses nulls to represent missing or unknown data values. XQuery returns sequences of XML data; SQL returns result sets of various SQL data types.
Reply With Quote  
Join Date: Sep 2007
Posts: 19
Reputation: s.piyush58 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
s.piyush58 s.piyush58 is offline Offline
Newbie Poster

Re: XML Management

  #35  
Oct 24th, 2007
Why should we use XQuery when we already have SQL? Is there any advantage in learning XQuery and using it?
Reply With Quote  
Join Date: Oct 2007
Posts: 36
Reputation: mallar6 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mallar6 mallar6 is offline Offline
Light Poster

Solution Re: XML Management

  #36  
Oct 24th, 2007
We can query data in DB2 XML columns using SQL or SQL with XML extensions (SQL/XML). Unfortunately, there's a lot you can't do with just SQL. Plain SQL statements enable you to retrieve full XML documents, but you can't retrieve partial XML documents or specific element values from an XML document. You need to use SQL with XML extensions (SQL/XML), XQuery, or a combination of both to retrieve partial XML documents. Xquery can offer powerful capabilities for searching and integrating traditional SQL and XML data. DB2 also supports bilingual queries -- that is, queries that combine expressions from both SQL and XQuery. Which language (or combination of languages) you should use depends on the application needs. You can check http://www.ibm.com/developerworks/db...m-0604saracco/ for more information about querying XML data using Xquery.
Reply With Quote  
Join Date: Oct 2007
Posts: 23
Reputation: karsoods53 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
karsoods53 karsoods53 is offline Offline
Newbie Poster

Re: XML Management

  #37  
Oct 24th, 2007
I have been using SQL queries all through. Can I just use SQL queries without having to learn Xquery?
Reply With Quote  
Join Date: Oct 2007
Posts: 36
Reputation: mallar6 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mallar6 mallar6 is offline Offline
Light Poster

Solution Re: XML Management

  #38  
Oct 24th, 2007
XML data can be queried with SQL statements. But it is not possible to query specific element of the XML document using plain XML. Please check http://www.ibm.com/developerworks/db...-0603saracco2/ for more information about querying XML data with SQL.
Reply With Quote  
Join Date: Oct 2007
Posts: 23
Reputation: karsoods53 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
karsoods53 karsoods53 is offline Offline
Newbie Poster

Re: XML Management

  #39  
Oct 25th, 2007
When should I use XQuery with embedded SQL?
Reply With Quote  
Join Date: Oct 2007
Posts: 36
Reputation: mallar6 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mallar6 mallar6 is offline Offline
Light Poster

Re: XML Management

  #40  
Oct 25th, 2007
XQuery with embedded SQL can be a good choice if you want to leverage relational predicates and indexes as well as full-text search to pre-filter the documents from an XML column which are then input to an XQuery. SQL embedded in XQuery also allows you to run external functions on the XML columns. But, if you need to perform data analysis queries with grouping and aggregations, you may prefer SQL/XML.
Reply With Quote  
Reply

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

DaniWeb RSS, Web Services and SOAP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

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 12:47 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC