mservidio
asked on
C# Oracle DataAccess CLOB insert issue
When I insert a CLOB to a table of some XML, starting with ?<, after the insert occurs and I look in the table data, the initial character (question mark), is flipped, and no longer a regular question mark but an upside down question mark which must be another character. Thus when reading it out, I get errors.
The variable test in this example is a string which holds the xml data.
What am I missing here? I have stepped through the code and ensured that when the parameter is set, that it indeed starts like ?<
The variable test in this example is a string which holds the xml data.
What am I missing here? I have stepped through the code and ensured that when the parameter is set, that it indeed starts like ?<
OracleCommand command = new OracleCommand("insert into gridview (gridviewid,stream,id,description,collapsed) " +
" values (gridview_seq.nextval,:stream,:id,:description,:collapsed) returning gridviewid into :gridviewid", conn);
command.Parameters.Add(":stream", OracleDbType.Clob, test, ParameterDirection.Input);
command.Parameters.Add(":id", OracleDbType.Int32, id, ParameterDirection.Input);
command.Parameters.Add(":description", OracleDbType.Varchar2, textEdit1.Text, ParameterDirection.Input);
command.Parameters.Add(":collapsed", OracleDbType.Int32,BoolToNumber(this.grid.IsCollapsed), ParameterDirection.Input);
command.Parameters.Add(":gridviewid", OracleDbType.Int32, ParameterDirection.Output);
command.ExecuteNonQuery();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window