michaelpanic
New Member
I need to parse xml (xmldata) from one database ( sql server ) then extract and load them up to a clean table and store them to another database ( mysql ) using python Here's my code\[code\]import pyodbcfrom lxml import etreefrom StringIO import StringIOcon_c = pyodbc.connect('DSN=database1;Database=y;UID=x;PWD=y')con_a = pyodbc.connect('DSN=database2;Database=x;UID=x;PWD=y')cur_a = con_a.cursor() cur_c = con_c.cursor() cur_c.execute("""select top 100id,xmldatafrom table1""")rows_c = cur_c.fetchall()for row in rows_c: x = str(row.xmldata) root = etree.fromstring(x) build_text_list = etree.XPath("//text()") texts = build_text_list(root) print((texts))\[/code\]Now.. here's what I am stuck with. "texts" is now "list" of value ... that I can print [scott,xx,...]them out, but how can I store the lists into Database2