[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: JDBC in an XQuery world (?)

  • From: John Cowan <cowan@mercury.ccil.org>
  • To: Michael Sokolov <sokolov@ifactory.com>
  • Date: Sun, 2 Oct 2011 14:40:11 -0400

Re:  JDBC in an XQuery world (?)
Michael Sokolov scripsit:

> let's map "xml root element name" to "table" and "document" to "row"

Sounds right.  It's "column" that's the hard idea.  Which of the
objects in a document count as columns?  Normal column names are just
identifiers, although it's possible to use arbitrary characters in
a column name if you wrap it in single quotes, so that would be an
escape for getting XPath expressions (though they would have to be
single-valued ones).  But the expectation is that there would be a
natural mapping of ordinary identifiers, and what would that be?  
Should we map the column identifier foo to the XPath /foo[1], or
perhaps //foo[1]?

> This might be enough for selects, but I guess for inserts you'd have
> to define column mappings.

Not just for inserts, but for selects as well, as shown above.  For
inserts you also have to define an *order* of columns and keep it in the
database somewhere, so that you can interpret "insert into foo values(1,
2, 3)" and know what column names are implied.


> These would probably have to be drawn from some subset of all xpath
> expressions like forward steps only, no function calls, something like
> that - I think MarkLogic searchable xpath expression is something like
> this).  You would have to introduce a new kind of schema for defining
> these mappings.

That makes sense for the escaped version of column names, except that
as I say SQL expects a column to be single-valued, so you need an
expression guaranteed to return one value.

-- 
[W]hen I wrote it I was more than a little              John Cowan
febrile with foodpoisoning from an antique carrot       cowan@ccil.org
that I foolishly ate out of an illjudged faith          http://ccil.org/~cowan
in the benignancy of vegetables.  --And Rosta


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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