Hi,
I know that XQuery is typically used for transforming XML into other
text file formats.
But is it possible to use XQuery for the other way round?
I want to transform a very simple SQL Create Table statement into XML.
SQL
===
CREATE TABLE mytable1
(
FIELD1xxx;
FIELD2
DB2 version 10 onwards lets you mix SQL and XQuery commands in one query.
On Thu, Aug 10, 2017 at 2:07 AM, wrote:
>
> Hi,
>
> I know that XQuery is typically used for transforming XML into other
> text file formats.
>
> But is it possible to use XQuery for the other
Hi Michael (Sahm),
maybe you’ll need to additionally give us more information on your requirements:
> I want to transform a very simple SQL Create Table statement into XML.
Would you like to parse your SQL (or just DDL) expressions in XQuery
and execute them in a second step? Do you want to
Hi Mike and Ghislain,
> Of course, parsing a full language like SQL is best done using the typical
> approaches (lexer, grammar, etc) as Mike suggests, and is not trivial. But if
> the subset is really very simple (as simple as your example), known in
> advance, and if there are no
Hi Christian,
> Would you like to parse your SQL (or just DDL) expressions in XQuery
> and execute them in a second step? Do you want to store SQL data in an
> XML database in a leter step, or do you only want to create a schema
> representation of your SQL table definitions in XML, resulting
XQuery has no built-in capability to parse SQL or to execute the result after
parsing.
You could generate an XQuery parser for a subset of SQL using REx
(http://www.bottlecaps.de/rex/), which would give you an XML representation of
the SQL command, and you could then write an XSLT or XQuery
Hi Michael,
I agree with Mike, but would add that with XQuery's FLWOR expressions, window
clauses, builtin functions (tokenize, replace, match, etc) as well as EXPath
modules, you can achieve a lot on text input that is "not too unstructured". I
did it quite a few times. Some engines also have
Here.
https://www.ibm.com/developerworks/data/library/techarticle/dm-1006queriespurexml/index.html
On Thu, Aug 10, 2017 at 2:13 AM, Ihe Onwuka wrote:
> DB2 version 10 onwards lets you mix SQL and XQuery commands in one query.
>
> On Thu, Aug 10, 2017 at 2:07 AM,