XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
lee martindaleSubject: SQL/XML Error
Author: lee martindale
Date: 29 Mar 2006 05:05 PM
I am trying to do a simple two table join. I can get it to work in base sql but when I try adding the XMLELEMENT all I get are errors.
this is from the pubs MS SQL Server database.


SELECT
XMLELEMENT(name "row",
XMLELEMENT(name "au_fname",a.authors.au_id),
XMLELEMENT(name "au_lname",a.authors.au_lname),
XMLELEMENT(name "au_fname",a.authors.au_fname),
XMLELEMENT(name "phone",a.phone)
XMLELEMENT(name "royaltyper",b.royaltyper)


FROM pubs.dbo.author a, pubs.dbo.titleauthor b
where a.authors.au_id = b.titleauthor.au_id

Posttop
Minollo I.Subject: SQL/XML Error
Author: Minollo I.
Date: 29 Mar 2006 05:18 PM
Try this:
SELECT
XMLELEMENT(name "row",
XMLELEMENT(name "au_fname",a.au_id),
XMLELEMENT(name "au_lname",a.au_lname),
XMLELEMENT(name "au_fname",a.au_fname),
XMLELEMENT(name "phone",a.phone),
XMLELEMENT(name "royaltyper",b.royaltyper)
)
FROM pubs.dbo.authors a, pubs.dbo.titleauthor b
WHERE a.au_id = b.au_id

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.