QL'98 - Position Paper

Andrew Eisenberg
Sybase, Inc.
November 18, 1998



 

The Problem that is Interesting to Sybase

Sybase customers are today able to store many types of values in their databases. We expect that our customers will also want to store XML documents and data in their databases. They will want to export the results of SQL queries as XML, and they will want to import XML to populate an update their tables.

XML may be stored in rows along with related scalar data. User queries will need to be able to span both types of data.

Procedural Access to XML

Sybase is a member of SQLJ, an informal group of companies that is interested in the use of Java and SQL together. This group has been meeting for about 1½ years, and has been working on 3 specifications:
SQLJ: Embedded SQL in Java
Allows the embedding of SQL statements in Java programs.
SQLJ: SQL Routines using the Java™ Programming Language
Allows the installation of Java classes in a database and the use of their methods as the implementations of procedures and functions.
SQLJ: SQL Types using the Java™ Programming Language
Allows Java classes to be used as the implementation of SQL3 User-defined Types.
SQLJ Part 0 is about to be adopted by NCITS as SQL Part 10: Object-Language Bindings (SQL/OLB). The other two parts will be submitted to NCITS shortly. Sybase has implemented a large amount of SQLJ Part 1 and Part 2 in its products already.
Java methods can be written to access parts of stored XML documents using a Java XML parser and DOM API. The SQLJ capabilities mentioned above allow these Java methods to be used directly in SQL queries and statements.

Non-procedural Access to XML

While procedural access to XML is an important first step, we would like to be able to offer customers a more declarative, non-procedural method of expressing their queries on XML documents.

In the old days users accessed data in their files a record at a time, and operations such as joins required the user to write a fair amount of code including several loops. This was both time consuming and error prone. Non-procedural query languages allowed users to express joins directly, and the execution of the joins was automatically optimized, taking into account the physical layout of the data and the existence of indices.

A non-procedural query language for XML documents should offer these same benefits to users.