Re: [gnome-db] XML Queries Proposal



On Sat, 6 Nov 2004 15:57:16 -0700, Neil Zanella <nzanella gmail com> wrote:
> Hello,
> 
> I had a quick glance at the following document on XML Queries:
> 
> http://www.gnome-db.org/docs/white-papers/xml-queries.php
> 
> I would like to request that the proposal be augmented with a mechanism for
> embedding parameter variables in this SQL syntax. For instance, in Java you
> can define a prepared query with question marks standinf for parameters. But
> Just for instance:
> 
> SELECT foo FROM JoesTable WHERE joesbar = $joesbar.

There is already a support for parameters in queries, though the
syntax is a bit different:
you example would be written as:

SELECT foo FROM JoesTable WHERE joesbar = ## [:name="joesbar"]

and more parameter specifications can be described between the square
brackets (data type, description, etc). For XML queries, there is no
such support that I know of.

Before a query is executed, it is necessary to ask it for its required
parameters, fill those parameters, and then run the query. The object
which manages the parameters is a a MgContext object (will be
GnomeDbContext).

> 
> But something more even more general is needed. I haven't thought about
> it in great detail (YET), but I am going to need this sometime soon if I am
> going to use XML syntax for SQL (so I can neatly embed SQL in the rest
> of my XML file format (which users use to describe behavior of data
> driven applications). Perhaps something like:
> 
> <!ELEMENT variable ...
> 
> <!ATTLIST vairable name ... data ... >
> 
> A separate module worries about deciding what the meaning of variable
> is and fills them out according to whatever way the program that parses
> the files with embedded XML Queries does with them.
> 
> So please add similar functionality to the DTD.

I think the <value> and <const>  tags need to be modified to add new
attributes to support parameters. I have not worked on the details of
the XML queries implementation so I don't know much about them. If you
have figured out how they work, could you write a small HOWTO use
them?

> 
> Also, table names need to be IDREF to table structures
> saved by mergeant in XML format. Same goes for
> attribute values.

Why?

Cheers,

Vivien



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]