Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CLOB Out parameters in stored procs and .NET OLEDB

116581Jul 22 2002
Hi all,

I am having trouble calling a stored procedure from ADO.NET using OLEDB 9.2 that has an out parameter that is a CLOB. Here is the procedure definition:

procedure test_clob(xml out clob);

The c# code:

string connStr = "Provider=OraOLEDB.Oracle;Persist Security Info=False;User ID=USER1;PASSWORD=PASSWD1;Data Source=DB1;OLEDB.NET=TRUE;SPPrmsLOB=TRUE";

string xml;
OleDbConnection conn = new OleDbConnection(connStr);
conn.Open();
OleDbCommand cmd = new OleDbCommand();
DataSet ds = new DataSet();
cmd.Connection = conn;
cmd.CommandText = "{ call customer_info.test_clob(?) }";
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add("xml",OleDbType.LongVarChar,10000);
cmd.Parameters["xml"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
xml = cmd.Parameters["xml"].Value.ToString();
MessageBox.Show(xml);

Error Message on cmd.ExecuteNonQuery():
Object reference not set to an instance of an object.

Does anyone know what may be causing this? The code is not much different from ADO 2.5 code and it worked fine then. Any help will be greatly appreciated. Thanks,

John Marklund


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2002
Added on Jul 22 2002
0 comments
715 views