[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Generic XML Data Request to Explict SQL Statement
- From: Jim Pinkelman <jimpi@enth.com>
- To: xml-dev@lists.xml.org
- Date: Thu, 22 Feb 2001 13:49:46 -0600
For the past two years, our company specialized in allowing
data requests to be submitted and dynamically transformed into
explicit SQL Statements.
XML provides an OUTSTANDING abstraction layer for accessing distributed,
relational databases.
http://www.enth.com/home/sqldemo/index.asp shows our product in action.
For example, for a particular relational data model.
<QUERY Schema="Sales">
<LEVELS>
<LEVEL Name="Year"/>
<LEVEL Name="ProductName">
<CONSTRAINTS>
<CONSTRAINT Value="Hat"/>
</CONSTRAINTS>
</LEVEL>
<LEVEL Name="StoreName"/>
<LEVEL Name="TotalUnits"/>
<LEVEL Name="TotalDollarsPerUnit"/>
</LEVELS>
</QUERY>
is translated into
SELECT
"Time Dimension - Year"."Year" AS "Year",
"Product Dimension"."ProductName" AS "ProductName",
"Store Dimension"."StoreName" AS "StoreName",
SUM("Sales Fact - Year"."Units") AS "TotalUnits",
SUM("Sales Fact - Year"."Dollars")/SUM("Sales Fact - Year"."Units")
AS "TotalDollarsPerUnit"
FROM
"Time Dimension - Year",
"Product Dimension",
"Store Dimension",
"Sales Fact - Year"
WHERE
"Product Dimension"."ProductName" = 'Hat' AND
"Time Dimension - Year"."YearID" = "Sales Fact - Year"."YearID" AND
"Product Dimension"."ProductID" = "Sales Fact - Year"."ProductID"
AND
"Store Dimension"."StoreID" = "Sales Fact - Year"."StoreID"
GROUP BY
"Time Dimension - Year"."Year",
"Product Dimension"."ProductName",
"Store Dimension"."StoreName"
ORDER BY 1, 2, 3
Jim Pinkelman, Ph. D.
VP - Technology
Enth
jimpi@enth.com
630.986.8700
Selberg wrote:
> Are there examples of using XML as a substitute for
> an SQL query? I mean examples of using a DTD to define
> a valid search given as XML as the search criteria in
> a database?
winmail.dat