Link to home
Start Free TrialLog in
Avatar of cpeters5
cpeters5

asked on

What is wrong with this query

Should this query returns
99-32G56, Vaccine, TRIM, VAC
?

It returns no row.
Pax

DECLARE @x xml; 
SET @x = N'<book>
		<book_number>99-32G56</book_number>
		<book_title>Vaccine</book_title>
		<abbreviated_title>VAC</abbreviated_title>
		<institute>TRIM</institute>
		<coordinator>
			<name>May Flower</name>
			<phone>3014513267</phone>
		</coordinator>
		<address>Building 45
Room 11C23
10 Center Drive
Middle Row, MD 20000</address>
		<start_date>2002-04-17</start_date>
		<end_date>2001-11-20</end_date>
</book>';
		
		select 
		c.value(N'(book/book_number)[1]', N'nvarchar(20)') AS bookID ,
		c.value(N'(book/book_title)[1]', N'nvarchar(100)') AS title, 
		c.value(N'(book/institute)[1]', N'nvarchar(100)') AS ins,
		c.value(N'(book/abbreviated_title)[1]', N'nvarchar(100)') AS abb_title

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cpeters5
cpeters5

ASKER

Thanks Brandon.  I will be back with more questions.  This is just the first trial of my attempt to load large xml file into databases.  I am still struggling...
pax
May I ask why a accurate, functional answer on my FIRST post deserves a "B" grade?
Avatar of modus_operandi
cpeters5,
 
BrandonGalderisi has asked (https://www.experts-exchange.com/questions/24321321/18-Apr-09-14-Automated-Request-for-Attention-Q-24303269.html) for an explanation of the grade you awarded for this question. Please read https://www.experts-exchange.com/help.jsp?hi=403 and then respond to the request for an explanation of the grade given.
 
As indicated in that help topic, a typical grade here is an A.  If the Expert(s) provided you a good starting point but you still had to add a significant amount of work or research to find the eventual solution, then a B is common, but when you use the B grade you should post an explanation as to why you awarded a B, including what you had to do on your own to get to the solution.
 
A C grade is usually reserved only for those cases where the Expert(s) gave vague and/or incomplete responses, and then did not reply to reasonable requests for further information.  Before you award a C, you should *always* post a comment in your question clearly stating the gaps in the current responses, and then allow a reasonable amount of time for the Expert(s) to address those gaps.  Indeed, many Experts would prefer having a question deleted altogether than to have a question closed with a C.
 
Please review this message and the help topic linked above.  If after doing so you want to change the grade then post a comment to this question to that effect and a Moderator will help you.
 
Thank you,
 
modus_operandi
EE Moderator