List:Internals« Previous MessageNext Message »
From:Masood Mortazavi Date:April 2 2009 5:42am
Subject:Re: load XML data
View as plain text  
Hi Erik -

This is interesting stuff ...

How about doing the paper work required before review can progress:
http://forge.mysql.com/wiki/Contributing_Code#Paperwork

Even if the contribution doesn't make it into the code, it can get
some attention and review and something may transpire based on it.

(I believe there has already been some development in a similar area.
Experts can pursue, based on plans and what exists already.)

Best regards,
Masood


On Sun, Dec 10, 2006 at 6:45 AM, mailbox@stripped
<erik@stripped> wrote:
> Hi,
> A first version of the LOAD XML is now available. It is based on the
> LOAD DATA command, and has the following syntax:
>   LOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
>    [REPLACE | IGNORE]
>    INTO TABLE tbl_name
>    ROWS IDENTIFIED BY 'row_tag'
>    [IGNORE number LINES]
>    [(col_name_or_user_var,...)]
>    [SET col_name = expr,...)]
> Basically this is the same syntax as LOAD DATA, and the xml import
> also works the same way. The main difference is that the LINES and
> FIELDS clauses are not supported.
>
> Instead a ROWS IDENTIFIED BY clause is used. For every tag with this
> tag name the command will try to create a record. It will match all
> tags and attributes inside the row tag and all tags and attributes on a
> higher level with the columns in the target table and fill in values
> accordingly.
>
> The command supports three different xml formats:
> field values as attributes: “<row field1='value' field2='value2'
> />”
> field values as tags:
>
> <row><field1>value</field1><field2>value2</field2></row>
> the format used by other MySQL tools, where the field name is an
> attribute, and the value is in the tag:
>   <row><field name='field1'>value</field></row>
>
> The three formats can be used in the same xml file, the import will
> automatically detect them. The tags are matched based on tag/attribute
> name and column name.
>
> Changes are in attached patch file. Four files are affected:
> lex.h (only add symbol XML_SYM)
> sql_class.h (add enum_filetype and use in sql_exchange)
> sql_yacc.yy (definition of command LOAD XML)
> sql_load.cc(the implementation)
>
> Erik Wetterberg
>
>
> --
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals?unsub=1
>
>
Thread
RE: load XML datamailbox@wetterberg.com10 Dec
  • Re: load XML dataErik Wetterberg10 Dec
  • Re: load XML dataMasood Mortazavi2 Apr 2009