473,388 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Some XQuery/SQL Server 2005 help please

CK
This query

SELECT DeliveryList.query('declare default element namespace
http://schemas.adventure-works.com/DeliverySchedule;
<DeliveryRoute>
<RouteNo>{ sql:column("D.DeliveryRoute") }</RouteNo>
for a$ in /DeliveryList/Delivery/Address
return
<Address>a$</Address>
</DeliveryRoute>')
as Result
FROM Sales.DeliverySchedule D

Returns this XML

<DeliveryRoute xmlns="http://schemas.adventure-works.com/DeliverySchedule">
<RouteNo>3</RouteNo>
for a$ in /DeliveryList/Delivery/Address
return
<Address>a$</Address></DeliveryRoute>

I need it to return this XML
<DeliveryRoute xmlns="http://schemas.adventure-works.com/DeliverySchedule>

<RouteNo<3>/RouteNo>

<Address>6126 North Sixth Street, Rockhampton</Address>

<Address>6445 Cashew Street, Rockhampton</Address>

</DeiveryRoute>

What am I doing wrong? Any ideas? All help is appreciated.

TIA, ~CK


Nov 27 '06 #1
1 1265
CK
Here is the original XML Doc
<?xml version="1.0" ?>
- <DeliveryList xmlns="http://schemas.adventure-works.com/DeliverySchedule">
- <Delivery SalesOrderID="43659">
<CustomerName>Steve Schmidt</CustomerName>
<Address>6126 North Sixth Street, Rockhampton</Address>
</Delivery>
- <Delivery SalesOrderID="43660">
<CustomerName>Tony Lopez</CustomerName>
<Address>6445 Cashew Street, Rockhampton</Address>
</Delivery>
</DeliveryList>

"CK" <c_**********@hotmail.comwrote in message
news:Dq*****************@newssvr21.news.prodigy.ne t...
This query

SELECT DeliveryList.query('declare default element namespace
http://schemas.adventure-works.com/DeliverySchedule;
<DeliveryRoute>
<RouteNo>{ sql:column("D.DeliveryRoute") }</RouteNo>
for a$ in /DeliveryList/Delivery/Address
return
<Address>a$</Address>
</DeliveryRoute>')
as Result
FROM Sales.DeliverySchedule D

Returns this XML

<DeliveryRoute
xmlns="http://schemas.adventure-works.com/DeliverySchedule">
<RouteNo>3</RouteNo>
for a$ in /DeliveryList/Delivery/Address
return
<Address>a$</Address></DeliveryRoute>

I need it to return this XML
<DeliveryRoute xmlns="http://schemas.adventure-works.com/DeliverySchedule>

<RouteNo<3>/RouteNo>

<Address>6126 North Sixth Street, Rockhampton</Address>

<Address>6445 Cashew Street, Rockhampton</Address>

</DeiveryRoute>

What am I doing wrong? Any ideas? All help is appreciated.

TIA, ~CK


Nov 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ken North | last post by:
Dr. Michael Rys of Microsoft discusses SQL Server 2005 support for XQuery, SQL/XML and the SQL:2003 standard. He discusses b-tree, quadtree, and r-tree indexes and pluggable and selectable indexing...
0
by: Benjamin G. Jones | last post by:
I am having a very basic problem with XQuery. I want to use an XQuery API in Java (either Saxon or Qexo), and I have an XQuery expression that works as expeced from the command line if I specify...
0
by: Tony Lavinio | last post by:
Dear Stylus Studio Friends, The new year is scarcely one month old, but we already have lots to report! For starters, there's Stylus Studio 6 Release 2. The latest release of Stylus Studio...
1
by: Tobias Walter | last post by:
Hi, does anyone kown if the final release or one of the next Betas of SQL-Server 2005 will support XQuery-Statemets including the LET-Feature. Thanks, Tobias
2
by: Ken | last post by:
I am trying to query data in an XML variable and I am having trouble getting the data out in the format that I would like. Given the following XML: declare @myDoc xml set @myDoc = '<Ownership...
0
by: Stylus Studio | last post by:
DataDirect XQuery(TM) is the First Embeddable Component for XQuery That is Modeled after the XQuery API for Java(TM) (XQJ) BEDFORD, Mass.--Sept. 20, 2005--DataDirect Technologies...
8
by: Clamps | last post by:
So I've been reading about XQuery, but cannot find a dll or namespace download to use the technology in vs.net 2002 or 2003. Any directions would be great. -- "If I'm the president, we're going...
0
by: HNguyen | last post by:
Hi, I have a problem of binding data from XQuery to a dataset. Here is the program I've extracted from 4guysfromrolla.com. This program read data from an XML file (Employees.xml) and performed...
2
by: BK | last post by:
I am working on system that will have a cataloging component which would essentially be a Folder/File structure. So far I have coded the Iteration over a selected folder and am displaying the...
5
by: CK | last post by:
I have the following XML in an XML column in a SQL 2005 Database. <DeliveryList xmlns="http://schemas.adventure-works.com/DeliverySchedule"> <Delivery SalesOrderID="43659"> <CustomerName>Steve...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.