Calling Oracle Procedure with CLOB input parameter (error)

Calling Oracle Procedure with CLOB input parameter (error)

Postby inspectorDev » 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();
                }
            }
inspectorDev
 
Posts: 19
Joined: Mon 04 Jan 2016 15:04

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

Postby Shalex » Wed 17 Feb 2016 19:06

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.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle