How to read data from XML file in SQL Server using Python script

37
February 06, 2019, at 00:20 AM

I am trying to read data from XML file using python script. XML file is pretty simple it has 3 elements Name, PhoneNumber and EmailAddress. I want it as a table at the end in the result sets. Whenever I execute below code I am getting error

EXECUTE sp_execute_external_script 
@language = N'Python', 
@script = N'import xml.etree.ElementTree as ET
import pandas as pd
tree = ET.parse("C:/EmployeeData.xml")
root = tree.getroot()
for member in root.findall("Employee"):
    employee =  pandas.Series([])
    name = member.find("Name").text
    employee.append(name)
    PhoneNumber = member.find("PhoneNumber").text
    employee.append(PhoneNumber)
    EmailAddress = member.find("EmailAddress").text
    employee.append(EmailAddress)
    OutputDataSet = pd.DataFrame(employee)',
@input_data_1 = N''
WITH RESULT SETS (([Name] varchar(100), [PhoneNumber] varchar(20), [EmailAddress] varchar(100)));
READ ALSO
namedtuple TypeError count of positional arguments

namedtuple TypeError count of positional arguments

Why does the TypeError message indicate 3 positional arguments if the namedtuple only calls for two? Why does it say that 4 were given?

64
hide an element on hover css that is not a direct child

hide an element on hover css that is not a direct child

There is a gap in my css knowledge hereI am trying to hide an element when another element is hovered on using styled-components

26
Bit Shifting - Why is this code using 24, 16, and 8 right shift?

Bit Shifting - Why is this code using 24, 16, and 8 right shift?

I am looking at this java code and trying to understand itI understand everything about it except the bit shifting part

53
Dividing fetched values by other fetched values produce zero instead of proper double

Dividing fetched values by other fetched values produce zero instead of proper double

Well I have a program (In eclipse, with Java) that's using matrix multiplication and suchAnd for this particular problem, I have a 2x2 matrix that needs to be multiplied by values calculated by my program

32