Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    33

    Unanswered: How to search a text in xml using sql

    Hello everybody,
    I need a little help to retrieve a xml data that contain specified word.

    Code:
    Sample XML documents stored in "contactinfo" column of the "clients" table
    	
    <Client>
    	<Address>
    		<street>5401 Julio Ave.</street>
    	</Address>
    	<phone>
    		<work>4084630000</work>
    	</phone>
    	<fax>4087776666</fax>
    	<email>love2shop@yahoo.com</email>
    </Client>
    
    <Client>
    	<Address>
    		<street>1543 St. Te.</street>
    	</Address>
    	<phone>
    		<work>123456</work>
    	</phone>
    </Client>
    How can I bring out the the XML data above with SQL command without have to specified which XML tag..

    For example,
    SELECT contactinfo FROM client where (all string in all XML tags) like %123%

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •