Calling Oracle Procedure with CLOB input parameter (error)

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
inspectorDev
Posts: 19
Joined: Mon 04 Jan 2016 15:04

Calling Oracle Procedure with CLOB input parameter (error)

Post by 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();
                }
            }

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by 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.

Post Reply