Page 1 of 1

Calling Oracle Procedure with CLOB input parameter (error)

Posted: Wed 17 Feb 2016 18:26
by inspectorDev
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();
                }
            }

Re: Calling Oracle Procedure with CLOB input parameter (error)

Posted: Wed 17 Feb 2016 19:06
by Shalex
Please send us a small complete test project with the corresponding DDL script of your proc_clob stored procedure so that we can reproduce the "incorrect type or number of arguments" error in our environment.