Link to home
Create AccountLog in
Avatar of shore-support
shore-support

asked on

How to pass xml as paremeter to mysql procedure and parse it and insert the values in to database tables.

Hi,

I want to send an xml as parameter to mysql procedure.

the format of xml is as follows:

<dbas>
  <dba>dba1</dba>
  <dba>dba2</dba>
  <dba>dba3</dba>
  <dba>dba4</dba>
  <dba>dba5</dba>
  <dba>dba6</dba>
</dbas>

above xml has 6 data elements which has to be inserted as 6 rows in to my mysql database table.

my table have 2 columns, Id and dba. Id will be auto generated.

I am completely new to mysql, so please give the clear explanation with sample procedure.

Note: my application is .net with mysql.

Thanks,
Shashi



Avatar of dr_linux
dr_linux
Flag of United States of America image

http://dev.mysql.com/tech-resources/articles/xml-in-mysql5.1-6.0.html

That link explains in detail what you need to do.  It will take you through importing xml data and exporting xml data.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of shore-support
shore-support

ASKER

Hi dr linux,

we are using 5.0 so the link u have given is for 5.1.5

i am getting the error at function not exists at Extractvalue function,
i think this is not supported in 5.0.

is there a way to achieve the same in 5.0

Thanks,
Shashi