I am facing issues to use Oracle with C#. We are moving away from SQL to Oracle and our S/W vendor provide us APIusing the AX_Gate.Process method, to return trading styles via a PL/SQL anonymous block:
declare
vMName varchar2(100);
vInput XMLtype;
vOutput XMLtype;
begin
vMName := 'Marketing Styles';
vInput := XMLtype('<Marketing_Styles-Read/>');
vOutput := AX_Gate.Process(vMethodName, vInput);
DBMS_OUTPUT.PUT_LINE(vOutput.getStringVal());
end;
To use this process in C# i develope code that is able to send information but it is not sending back the required XML output. C# code is below:
try
{
//Oracle connection open
OracleConnection.Open();
//SQL script to invoke AX_Gate.Process
string SQLScript = "declare vMName varchar2(100); vInput XMLtype; vOutput XMLtype; "+
"begin vOutput := AX_Gate.Process(" + vMethodName + " , " + vInput + "); end;";
OracleCommand OraCommand = new OracleCommand(SQLScript);
OraCommand.Connection = OracleConnection;
OraCommand.CommandType = System.Data.CommandType.Text;
//OraCommand.Parameters.Add(new OracleParameter("vOutput", OracleDbType.XmlType, ParameterDirection.Output));
OraCommand.Parameters.Add(new OracleParameter("vOutput", OracleDbType.XmlType)).Direction = ParameterDirection.Output;
//OracleDataReader dr = new OracleDataReader();
OracleXmlType poXml;
OracleDataReader poReader = OraCommand.ExecuteReader();
var sqlDataAdapter = new OracleDataAdapter(OraCommand);
var dataTable = new DataTable("vOutput");
sqlDataAdapter.Fill(dataTable);
OracleConnection.Close();
How can I send XML and retrieve back output as an XML using above Oracle process / procedure.
Thank You