Calling Oracle Procedure with CLOB input parameter (error)
Posted: Wed 17 Feb 2016 18:26
Hello, I want to read a text file into a string array and send that to a procedure that has declared a CLOB input parameter for the data. I have tried the following, but I get the "incorrect type or number of arguments" error. How do I send the contents of a text file to a CLOB parameter using Devart.Data.Oracle.dll ? Thanks
Code: Select all
string[] s = File.ReadAllLines(@"c:\temp\test.txt");
connectionString = Helper.GetConnectionString();
using (OracleConnection connection = new OracleConnection(connectionString))
{
connection.Open();
using (OracleCommand cmd = Helper.CreateCommand("proc_clob"))
{
cmd.Connection = connection;
//note-this extension method on cmd takes the name of param, type, and value
cmd.AddInputParameter<string[]>("data", OracleDbType.Clob, s);
cmd.ExecuteNonQuery();
}
}