From derby-dev-return-18099-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Mon Apr 03 16:30:48 2006 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 85136 invoked from network); 3 Apr 2006 16:30:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Apr 2006 16:30:47 -0000 Received: (qmail 94459 invoked by uid 500); 3 Apr 2006 16:30:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 94430 invoked by uid 500); 3 Apr 2006 16:30:45 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 94421 invoked by uid 99); 3 Apr 2006 16:30:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 09:30:44 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,RCVD_IN_SORBS_WEB X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [68.142.199.126] (HELO web81310.mail.mud.yahoo.com) (68.142.199.126) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 03 Apr 2006 09:30:44 -0700 Received: (qmail 40250 invoked by uid 60001); 3 Apr 2006 16:30:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=3JvHNkI0smwzi0sPiVlNNjjIKPf120YCMDM0776HssH6f+BRayOb0jeZaB6ZzBgRxjn7IbluohokDZlJ+IxR3LKTXYkAOBscjjAM5cSzIfy2SRgDWF1rXbmGn2CK2ZM1f07W5hhQ2QSC64MSpbP2larFoQCdJWm0QLVA7xuqvZI= ; Message-ID: <20060403163022.40248.qmail@web81310.mail.mud.yahoo.com> Received: from [32.97.110.142] by web81310.mail.mud.yahoo.com via HTTP; Mon, 03 Apr 2006 09:30:22 PDT Date: Mon, 3 Apr 2006 09:30:22 -0700 (PDT) From: Susan Cline Subject: Re: XML support in 10.2 - selecting values of an XML element in an order by query? To: derby-dev@db.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Satheesh, Thanks for your comments. I've included some responses inline below. Susan --- Satheesh Bandaram wrote: [ snip ] > > There is no way to extract parts of XML documents out into SQL world, which > could allow you to do order by. > > However, you may be able to write your own Java function that takes > serialized XML as function argument along with XPath expression and return > your item of interest. You could then order by on this expression, thanks to > Tomohito's extension to ORDER BY. Okay, I may or may not look into this, but thanks for the suggestion. > > If you are doing all this, then why even store XML documents in XML type and > not just use CLOB or VARCHAR? In the application I am using I want the database to return XML. But given the inability of Derby to perform this type of query at the present time I may just do the parsing of the XML document on the client. [snip] > Thanks for trying Derby XML... and for being brave to figure out > dependencies! Hopefully 10.2 XML support would be more complete and show up > in documentation. You bet! > On 3/31/06, Susan Cline wrote: > > > > Hi, > > > > I've looked at some of the tests for the XML support but I am still > > confused if this is possible or not. Given a table created with > > an xml column: > > > > create table xmlTab (id integer, xml_col xml); > > > > Containing these two xml documents: > > > > > > 1 > > Susan > > Cline > > > > > > > > 2 > > Apache > > User > > > > > > I'd like to come up with a query that returns results ordered by > > firstname (or any other element in the XML document.) > > [snip]