Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Doing a join between XML data typed field and a relational table in Yukon (SQL 2005)

From: "Han" <hp4444@------.---.----->
To: NULL
Date: 8/1/2004 4:13:00 PM
You can use ordinary sql join syntax, i.e. sqlxml, even for xml fields.

use db1
go
--create table t1 (pk int, t varchar(5))
go
--insert into t1 values(1,'a')
go
--create table t2 (fk int, x xml)
go
--insert into t2 values(1, '<x/>')
go
select * from t1 INNER JOIN t2 ON t1.pk = t2.fk for xml auto, elements,
root('x')

For additional query against xml field, you can use XQuery

"Nitsan" <nitsan.shaked@i...> wrote in message
news:31b6c8ae.0407120307.29fa2ff5@p......
> Hello,
>
> I have a Yukon XML question and would be very happy if someone can
> assist:
>
> Let's assume I have 2 tables:
>
> One will be product table ?Regular relational table with Product ID
> as a primary key and some descriptive fields.
>
> Second is an Order table ?it has Order ID as a PK and Order details
> which is a field of XML data type and holds all lines in the order
> including quantity, product id, prices, etc.
>
> I want to make a join that will present the orders with all product
> details for each order line.
>
> Do you know how can I do a Join between XML field and relational
> table?
>
> Thanks,
> Nitsan




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent