On Wed, 4 Feb 2004, Rick Measham wrote:

> I'd love to see an XML parser embedded into SQL so that I can have: 
> CREATE TABLE aTable (id serial, data XML); 

Does this help?

    % mysqldump --help | grep -i ml
      -X, --xml           Dump a database as well formed XML.

    % mysql --help | grep -i ml
      -H, --html          Produce HTML output.
      -X, --xml           Produce XML output
    html                              FALSE
    xml                               FALSE

    % mysql --version
    mysql  Ver 12.22 Distrib 4.0.17, for apple-darwin7.2.0 (powerpc)

This is the current unstable version in Fink; I'm not sure that the
feature to output XML is present in the stable version, but I'd assume so. 

You're welcome to read the docs yourself to see how to use this, but
here's a sample:

    % mysql -u cdevers -p -X -D movabletype
            -e "select author_name from mt_author"
    Enter password: 
    <?xml version="1.0"?>
    
    <resultset statement="select author_name from mt_author">
      <row>
            <author_name>cdevers</author_name>
      </row>
    
      <row>
            <author_name>hanna</author_name>
      </row>
    
      <row>
            <author_name>kelly</author_name>
      </row>
    
      <row>
            <author_name>may</author_name>
      </row>
    </resultset>

Is this along the lines of what you were hoping for?




-- 
Chris Devers

Reply via email to