dbTalk Databases Forums  

SQL/Xquery

microsoft.public.sqlserver.xml microsoft.public.sqlserver.xml


Discuss SQL/Xquery in the microsoft.public.sqlserver.xml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
punyavee napalai
 
Posts: n/a

Default SQL/Xquery - 02-02-2012 , 05:31 AM






Hi

Let say I have the table of 2 fields,
Project >> VCHAR2
XML >> XMLtype (containing XML data)

In my XML field record 1, I have
<Project ID='P01', Title='ABC'>
<Task ID='001'>
</Task>
</Project>

I don't have any content between elements but I would like to know how I can reach to the attribute value in the XMLtype field? For example, I like to write a query to show the Task's ID of the Project ID 'P01'. I have tried EXTRACT(), EXTRACTVALUE() in the SELECT,FROM,WHERE but it doesn't work.

Your help would be very appreciated, thank you very much.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.