I'm trying to create a XML in stored procedure in this way:
PROCEDURE DeviceSearched(
xml_out OUT XMLTYPE
)
IS
BEGIN
SELECT
XMLELEMENT("Values",
XMLFOREST(de_brand)
)
INTO xml_out
FROM
tbldevice de
;
END DeviceSearched;
And I trying to read xml_out in c# in this way:
...
OracleCommand command = new OracleCommand(name, conn);
command.CommandType = CommandType.StoredProcedure;
command.BindByName = true;
...
command.Parameters.Add(new OracleParameter("xml_out", OracleDbType.XmlType, ParameterDirection.Output));
With this approach the issues are two:
- Oracle exception: "ORA-01422: exact fetch returns more than requested number of rows"
- If I modify the query to obtain one row, the procedure is ok (I think), but in c# I don't have any result.
What am I doing wrong?
Thanks in advance