Hi,

> FOR XML AUTO

> I wanted to modify the sql grammar
> so it would be processed automatically.  How feasible is it to do
> this?

I don't know. I'm not sure how complex the solution would be, and I'm
not sure how useful it would be. To me, it looks like it would add
quite a lot of complexity to the parser. I'm not sure if it's a good
idea to add such features into the database engine itself - wouldn't
it make more sense to use a solution that is database independent, so
it can be used for other databases as well? FOR XML seems to be
available in MS SQL Server only.

H2 supports XML features that are much less invasive to the database
engine itself:

http://h2database.com/html/functions.html#xmlattr
http://h2database.com/html/functions.html#xmlnode
http://h2database.com/html/functions.html#xmlcomment
http://h2database.com/html/functions.html#xmlcdata
http://h2database.com/html/functions.html#xmlstartdoc
http://h2database.com/html/functions.html#xmltext

Those are simple text functions. They can be ported to any database
(including MS SQL Server). They don't require any change in the
database engine or parser, or any special data type. An example on how
to use those functions is:

http://code.google.com/p/h2database/source/browse/trunk/h2/src/test/org/h2/samples/newsfeed.sql

This will give you full control over the generated XML (you could even
generate HTML if required).

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-database@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to