Error inserting CLOB.
Posted: Wed 06 Feb 2008 20:25
I'm trying to insert a CLOB into Oracle 11g. I am using the following C# code:
parameter = cmd.Parameters.Add("SOURCETEXT", UniDbType.Clob);
parameter.Value = sSourceText;
cmd.Parameters.Add(parameter);
The parameter value is correct when I look at the debugger, however, I always get an error when I try to execute the query with:
cmd.ExecuteNonQuery();
I get the error "Can not convert." The UniDbType field in the cmd.Parameters for this has the following error in it.
UniDbType '((CoreLab.UniDirect.UniParameter)((new System.Collections.ArrayList.ArrayListDebugView(((CoreLab.Common.DbParameterBaseCollection)(cmd.Parameters.System.Collections.ICollection.SyncRoot)).InnerList)).Items[9])).UniDbType' threw an exception of type 'System.ArgumentException' CoreLab.UniDirect.UniDbType {System.ArgumentException}
Can someone tell me what I am doing wrong. I have fix or six other fields with the same structure (just different UniDbTypes) and they work fine.
Thanks.
parameter = cmd.Parameters.Add("SOURCETEXT", UniDbType.Clob);
parameter.Value = sSourceText;
cmd.Parameters.Add(parameter);
The parameter value is correct when I look at the debugger, however, I always get an error when I try to execute the query with:
cmd.ExecuteNonQuery();
I get the error "Can not convert." The UniDbType field in the cmd.Parameters for this has the following error in it.
UniDbType '((CoreLab.UniDirect.UniParameter)((new System.Collections.ArrayList.ArrayListDebugView(((CoreLab.Common.DbParameterBaseCollection)(cmd.Parameters.System.Collections.ICollection.SyncRoot)).InnerList)).Items[9])).UniDbType' threw an exception of type 'System.ArgumentException' CoreLab.UniDirect.UniDbType {System.ArgumentException}
Can someone tell me what I am doing wrong. I have fix or six other fields with the same structure (just different UniDbTypes) and they work fine.
Thanks.